All pages
Powered by GitBook
1 of 1

Loading...

SHOW CREATE VIEW

Display the CREATE VIEW statement. This statement shows the SQL query that defines a specific view structure.

Syntax

Description

This statement shows a CREATE VIEW statement that creates the given view, as well as the character set used by the connection when the view was created. This statement also works with views.

SHOW CREATE VIEW quotes table, column and stored function names according to the value of the server system variable.

Examples

With off:

Grants

To be able to see a view, you need to have the and the privilege on the view:

See Also

This page is licensed: GPLv2, originally from

SHOW CREATE VIEW [view-name]
sql_quote_show_create
sql_quote_show_create
SHOW VIEW
SELECT
Grant privileges to tables, views etc
fill_help_tables.sql
SHOW CREATE VIEW example\G
*************************** 1. row ***************************
                View: example
         Create View: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL
SECURITY DEFINER VIEW `example` AS (select `t`.`id` AS `id`,`t`.`s` AS `s` from
`t`)
character_set_client: cp850
collation_connection: cp850_general_ci
SHOW CREATE VIEW example\G
*************************** 1. row ***************************
                View: example
         Create View: CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECU
RITY DEFINER VIEW example AS (select t.id AS id,t.s AS s from t)
character_set_client: cp850
collation_connection: cp850_general_ci
GRANT SHOW VIEW,SELECT ON test_database.test_view TO 'test'@'localhost';