SHOW CREATE PROCEDURE command¶
The SHOW CREATE PROCEDURE command returns the CREATE PROCEDURE statement that creates the specified user-defined procedure (UDP).
If the UDP is changed by using ALTER PROCEDURE after creation, the changes are reflected in the return of SHOW CREATE PROCEDURE.
Note
An operation involving a non-default schema or an object in it requires access to the schema, either implicitly or through an explicit USAGE grant, as well as the privilege required for the operation. The schema access check and the privilege check for the requested operation are independent; satisfying one does not satisfy the other. Schema access control does not apply to temporary graphs or built-in procedures and functions. For more information, see Schema access control.
Syntax¶
- show_create_procedure_command
show_create_procedure_command ::=
'SHOW' 'CREATE' 'PROCEDURE' procedure_name
Parameters¶
procedure_name¶
The name of the UDP for which to return the CREATE PROCEDURE statement.
Examples¶
'''
// Create a UDP
CREATE OR REPLACE PROCEDURE test1() RETURNS ret INT COMMENT 'test1' AS { RETURN 1 }
'''
'''
SHOW CREATE PROCEDURE test1
'''
Return:
+-----------+---------------------------------------------------------------------------------------+
| proc_type | create_statement |
+-----------+---------------------------------------------------------------------------------------+
| GQL | CREATE PROCEDURE test1() RETURNS (ret INT64) LANGUAGE GQL COMMENT test1{\nRETURN 1\n} |
+-----------+---------------------------------------------------------------------------------------+