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_DEFINITION
column has most of what you see in theCreate Table
field thatSHOW CREATE VIEW
produces. Skip the words beforeSELECT
and 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_OPTION
column always has a value ofNONE
. -
The
IS_UPDATABLE
column isYES
if the view is updatable,NO
if the view is not updatable. -
The
DEFINER
andSECURITY_TYPE
columns were added in MySQL 5.0.14.DEFINER
indicates who defined the view.SECURITY_TYPE
has a value ofDEFINER
orINVOKER
.