Purpose
Lists the properties of the user-defined types available in the current tenant. The DBA_TYPE_ATTRS view displays the attributes of user-defined types available in the database.
Applicability
This view applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
| 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 attribute. |
| ATTR_TYPE_MOD | VARCHAR2(7) | NO | At present, this column is not used. |
| ATTR_TYPE_OWNER | VARCHAR2(128) | NO | The owner of the attribute type. |
| ATTR_TYPE_NAME | VARCHAR2(324) | NO | The name of the attribute data type. |
| LENGTH | NUMBER(38) | NO | The length of the attribute type. |
| NUMBER_PRECISION | NUMBER(38) | NO | The decimal precision of the number attribute. |
| SCALE | NUMBER(38) | NO | The number of digits on the right of the decimal point in a number. |
| CHARACTER_SET_NAME | CHAR(7) | NO | The name of the character set of the attribute type.
|
| ATTR_NO | NUMBER(38) | NO | The serial number of the attribute. |
| INHERITED | CHAR(2) | NO | Indicates whether the attribute is inherited from a supertype. |
| CHAR_USED | CHAR(1) | YES | Indicates whether the attribute is defined based on byte length (B) or character length (C). |
Sample query
Query the attributes of all user-defined types in the current tenant and display the first 10 records.
obclient [SYS]> SELECT * FROM SYS.DBA_TYPE_ATTRS WHERE ROWNUM <=10;
Query result:
+-------+-------------+---------------+---------------+-----------------+----------------+--------+------------------+-------+--------------------+---------+-----------+-----------+
| 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
Related views or documents
View information about attributes of all custom types to which the current user has access: ALL_TYPE_ATTRS
View the attributes of the custom types that the current user owns: USER_TYPE_ATTRS