SHOW CREATE VIEW
Show the definition for a view. The output includes two columns:
path
: The path to the specified view.
sql_definition
: The definition for the specified view.
note
You need the SELECT
privilege on the view to retrieve the definition.
SHOW CREATE VIEW <view_name>
[ AT { REF[ERENCE] | BRANCH | TAG | COMMIT } <reference_name> ]
Parameters
<view_name> String
The name of the view whose definition you want to see.
AT { REF[ERENCE] | BRANCH | TAG | COMMIT } <reference_name> String Optional
Specify the reference for which you want to show the view definition:
REF
: Identifies the branch, tag, or commit for the view for which you want to show the available definition.BRANCH
: Identifies the branch for the view for which you want to show the available definition.TAG
: Identifies the tag for the the view for which you want to show the available definition.COMMIT
: Identifies the commit for the view for which you want to show the available definition. Commit hashes must be enclosed in double quotes (for example,“ff2fe50fef5a030c4fc8e61b252bdc33c72e2b6f929d813833d998b8368302e2”
).
Examples
Show the definition of a view in a specified referenceSHOW CREATE VIEW "company_data".Locations."offices_by_region"
AT REF "myBranch"