Note
This view is introduced since OceanBase Database V1.4.
Purpose
This view displays information about views.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TABLE_CATALOG | varchar(64) | NO | The name of the catalog to which the table belongs. |
| TABLE_SCHEMA | varchar(128) | NO | The name of the database. |
| TABLE_NAME | varchar(256) | NO | The name of the table. |
| VIEW_DEFINITION | longtext | NO | The view definition. |
| CHECK_OPTION | varchar(8) | NO | The check option. |
| IS_UPDATABLE | varchar(3) | NO | Indicates whether the view can be updated. |
| DEFINER | varchar(288) | NO | The username of the user who created the view. |
| SECURITY_TYPE | varchar(7) | NO | The security type. |
| CHARACTER_SET_CLIENT | varchar(64) | NO | The value of the session variable character_set_client when the view was created. |
| COLLATION_CONNECTION | varchar(64) | NO | The value of the session variable collation_connection when the view was created. |
Sample query
Query the details of the view view1.
obclient [infotest]> SELECT * FROM information_schema.VIEWS WHERE TABLE_NAME ='view1'\G
The query result is as follows:
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: infotest
TABLE_NAME: view1
VIEW_DEFINITION: select `infotest`.`tbl1`.`col1` AS `col1`,`infotest`.`tbl1`.`col2` AS `col2` from `infotest`.`tbl1` where (`infotest`.`tbl1`.`col1` > 0)
CHECK_OPTION: LOCAL
IS_UPDATABLE: YES
DEFINER: root@%
SECURITY_TYPE: NONE
CHARACTER_SET_CLIENT: utf8mb4
COLLATION_CONNECTION: utf8mb4_general_ci
1 row in set