The VIEWS table provides information about
views in databases. You must have the SHOW VIEW
privilege to access this table.
INFORMATION_SCHEMA
Name
|
SHOW Name
|
Remarks |
TABLE_CATALOG
|
NULL
|
|
TABLE_SCHEMA
|
||
TABLE_NAME
|
||
VIEW_DEFINITION
|
||
CHECK_OPTION
|
||
IS_UPDATABLE
|
||
DEFINER
|
||
SECURITY_TYPE
|
Notes:
-
The
VIEW_DEFINITIONcolumn has most of what you see in theCreate Tablefield thatSHOW CREATE VIEWproduces. Skip the words beforeSELECTand skip the wordsWITH CHECK OPTION. Suppose that the original statement was:CREATE VIEW v AS SELECT s2,s1 FROM t WHERE s1 > 5 ORDER BY s1 WITH CHECK OPTION;
Then the view definition looks like this:
SELECT s2,s1 FROM t WHERE s1 > 5 ORDER BY s1
-
The
CHECK_OPTIONcolumn always has a value ofNONE. -
The
IS_UPDATABLEcolumn isYESif the view is updatable,NOif the view is not updatable. -
The
DEFINERandSECURITY_TYPEcolumns were added in MySQL 5.0.14.DEFINERindicates who defined the view.SECURITY_TYPEhas a value ofDEFINERorINVOKER.