Note
This view is available starting with V2.2.30.
Purpose
This view lists the attributes of user-defined types owned by the current user.
Applicability
This view is available only in Oracle mode of OceanBase Database.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TYPE_NAME | VARCHAR2(64) | NO | The name of the type. |
| ATTR_NAME | VARCHAR2(64) | NO | The name of the attribute. |
| ATTR_TYPE_MOD | VARCHAR2(7) | NO | This column is not currently in use. |
| ATTR_TYPE_OWNER | VARCHAR2(128) | NO | The owner of the attribute type. |
| ATTR_TYPE_NAME | VARCHAR2(324) | NO | The name of the attribute type. |
| LENGTH | NUMBER(38) | NO | The length of the attribute type. |
| NUMBER_PRECISION | NUMBER(38) | NO | The length of the attribute numeric type. |
| SCALE | NUMBER(38) | NO | The length of the data to the right of the decimal point for the numeric type. |
| CHARACTER_SET_NAME | CHAR(7) | NO | The name of the character set of the attribute type:
|
| ATTR_NO | NUMBER(38) | NO | The attribute number. |
| INHERITED | CHAR(2) | NO | Indicates whether the attribute is inherited from the parent type. |
| CHAR_USED | CHAR(1) | YES | Indicates whether the attribute is defined based on the byte length (B) or the character length (C). |
Sample query
Query the attributes of user-defined types owned by the current user.
obclient [SYS]> SELECT * FROM SYS.USER_TYPE_ATTRS;
The query result is as follows:
+-------------+--------------+---------------+-----------------+----------------+--------+------------------+-------+--------------------+---------+-----------+-----------+
| TYPE_NAME | ATTR_NAME | ATTR_TYPE_MOD | ATTR_TYPE_OWNER | ATTR_TYPE_NAME | LENGTH | NUMBER_PRECISION | SCALE | CHARACTER_SET_NAME | ATTR_NO | INHERITED | CHAR_USED |
+-------------+--------------+---------------+-----------------+----------------+--------+------------------+-------+--------------------+---------+-----------+-----------+
| PROJECT_OBJ | PROJECT_NAME | NULL | NULL | VARCHAR2 | 100 | 2 | -1 | CHAR_CS | 1 | NO | C |
| PROJECT_OBJ | STATUS | NULL | NULL | VARCHAR2 | 20 | 2 | -1 | CHAR_CS | 2 | NO | C |
+-------------+--------------+---------------+-----------------+----------------+--------+------------------+-------+--------------------+---------+-----------+-----------+
2 rows in set
References
Query the attributes of all user-defined types in the current tenant: DBA_TYPE_ATTRS
Query the attributes of all user-defined types accessible to the current user: ALL_TYPE_ATTRS