Note
This view is available starting with V2.2.30.
Purpose
This view lists the attributes of user-defined types that are accessible to the current user.
Applicability
This view is applicable only to OceanBase Database in Oracle mode.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | NO | The owner of the object. |
| TYPE_NAME | VARCHAR2(64) | NO | The name of the type. |
| ATTR_NAME | VARCHAR2(64) | NO | The name of the type attribute. |
| ATTR_TYPE_MOD | VARCHAR2(7) | NO | This column is not 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's numeric type. |
| SCALE | NUMBER(38) | NO | The length of the data on the right side of the decimal point for numeric types. |
| 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 all user-defined types accessible to the current user, and display the first 10 rows.
obclient [SYS]> SELECT * FROM SYS.ALL_TYPE_ATTRS WHERE ROWNUM <=10;
The query result is as follows:
+-------+-------------+---------------+---------------+-----------------+----------------+--------+------------------+-------+--------------------+---------+-----------+-----------+
| OWNER | 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 |
+-------+-------------+---------------+---------------+-----------------+----------------+--------+------------------+-------+--------------------+---------+-----------+-----------+
| SYS | PROJECT_OBJ | STATUS | NULL | NULL | VARCHAR2 | 20 | 2 | -1 | CHAR_CS | 2 | NO | C |
| SYS | PROJECT_OBJ | PROJECT_NAME | NULL | NULL | VARCHAR2 | 100 | 2 | -1 | CHAR_CS | 1 | NO | C |
| SYS | DBMS_XA_XID | GTRID | NULL | NULL | RAW | 64 | -1 | -1 | CHAR_CS | 2 | NO | C |
| SYS | DBMS_XA_XID | BQUAL | NULL | NULL | RAW | 64 | -1 | -1 | CHAR_CS | 3 | NO | C |
| SYS | DBMS_XA_XID | FORMATID | NULL | NULL | NUMBER | -1 | -1 | -85 | CHAR_CS | 1 | NO | C |
| SYS | ODCICOLINFO | TABLESCHEMA | NULL | NULL | VARCHAR2 | 128 | 2 | -1 | CHAR_CS | 1 | NO | C |
| SYS | ODCICOLINFO | TABLENAME | NULL | NULL | VARCHAR2 | 128 | 2 | -1 | CHAR_CS | 2 | NO | C |
| SYS | ODCICOLINFO | COLNAME | NULL | NULL | VARCHAR2 | 4000 | 2 | -1 | CHAR_CS | 3 | NO | C |
| SYS | ODCICOLINFO | COLTYPENAME | NULL | NULL | VARCHAR2 | 128 | 2 | -1 | CHAR_CS | 4 | NO | C |
| SYS | ODCICOLINFO | COLTYPESCHEMA | NULL | NULL | VARCHAR2 | 128 | 2 | -1 | CHAR_CS | 5 | NO | C |
+-------+-------------+---------------+---------------+-----------------+----------------+--------+------------------+-------+--------------------+---------+-----------+-----------+
10 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 owned by the current user: USER_TYPE_ATTRS