Note
This view is available starting with V1.4.
Purpose
Records view information.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TABLE_CATALOG | varchar(64) | NO | The table catalog. |
| TABLE_SCHEMA | varchar(128) | NO | The database name. |
| TABLE_NAME | varchar(256) | NO | The name of the view. |
| VIEW_DEFINITION | longtext | NO | The definition of the view. |
| CHECK_OPTION | varchar(8) | NO | The check option. |
| IS_UPDATABLE | varchar(3) | NO | Indicates whether the view is updatable. |
| 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 character_set_client session variable at the time the view was created. |
| COLLATION_CONNECTION | varchar(64) | NO | The value of the collation_connection session variable at the time the view was created. |
Sample query
Query the details of the view1 view.
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