Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
This view displays the information of the tables and views used in the view definition.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| VIEW_CATALOG | varchar(64) | NO | The name of the directory where the view belongs. |
| VIEW_SCHEMA | varchar(128) | NO | The name of the schema where the view belongs. |
| VIEW_NAME | varchar(256) | NO | The name of the view. |
| TABLE_SCHEMA | varchar(128) | NO | The name of the schema where the table or view used in the view definition belongs. |
| TABLE_NAME | varchar(256) | NO | The name of the table or view used in the view definition. |
| TABLE_CATALOG | varchar(64) | NO | The name of the directory where the table or view used in the table definition belongs. The value of this column is always def. |
Sample query
Query information about the tables and views used in view v_test_tbl1.
obclient [infotest]> SELECT * FROM information_schema.VIEW_TABLE_USAGE WHERE VIEW_NAME='v_test_tbl1';
The query result is as follows:
+--------------+-------------+-------------+--------------+------------+---------------+
| VIEW_CATALOG | VIEW_SCHEMA | VIEW_NAME | TABLE_SCHEMA | TABLE_NAME | TABLE_CATALOG |
+--------------+-------------+-------------+--------------+------------+---------------+
| def | infotest | v_test_tbl1 | infotest | tbl6 | def |
+--------------+-------------+-------------+--------------+------------+---------------+
1 row in set