The Information Schema VIEWS table contains information about views. The SHOW VIEW privilege is required to view the table.

It has the following columns:

ColumnDescriptionAdded
TABLE_CATALOGAways def.
TABLE_SCHEMADatabase name containing the view.
TABLE_NAMEView table name.
VIEW_DEFINITIONDefinition of the view.
CHECK_OPTIONYES if the WITH CHECK_OPTION clause has been specified, NO otherwise.
IS_UPDATABLEWhether the view is updatable or not.
DEFINERAccount specified in the DEFINER clause (or the default when created).
SECURITY_TYPESQL SECURITY characteristic, either DEFINER or INVOKER.
CHARACTER_SET_CLIENTThe client character set when the view was created, from the session value of the character_set_client system variable.
COLLATION_CONNECTIONThe client collation when the view was created, from the session value of the collation_connection system variable.
ALGORITHMThe algorithm used in the view. See View Algorithms.MariaDB 10.1.3

Example

SELECT * FROM INFORMATION_SCHEMA.VIEWS\G
*************************** 1. row ***************************
       TABLE_CATALOG: def
        TABLE_SCHEMA: test
          TABLE_NAME: v
     VIEW_DEFINITION: select `test`.`t`.`qty` AS `qty`,`test`.`t`.`price` AS `price`,(`test`.`t`.`qty` * `test`.`t`.`price`) AS `value` from `test`.`t`
        CHECK_OPTION: NONE
        IS_UPDATABLE: YES
             DEFINER: root@localhost
       SECURITY_TYPE: DEFINER
CHARACTER_SET_CLIENT: utf8
COLLATION_CONNECTION: utf8_general_ci
           ALGORITHM: UNDEFINED

Comments

Comments loading...