Source: https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/procedures/alter/ Documentation version: v5.3.2 # ALTER PROCEDURE statement The ALTER PROCEDURE statement modifies a user-defined procedure (UDP) in the used schema, including its name and comment. To alter the input parameters accepted by a UDP without changing the name or procedure body, [drop the UDP](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/procedures/drop/) and create a new one. To alter the procedure body without changing the name or input parameters, use [CREATE OR REPLACE PROCEDURE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/procedures/create/). 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](https://dev-docs.nebula-graph.io/v5.3.2/server-admin/authorization/schema-access-control/). ## Prerequisites - The UDP is created. For more information, see [CREATE PROCEDURE](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/procedures/create/). - To alter a UDP, you must either be the owner of the UDP, be granted to perform the action `ALTER` on the UDP, or be granted to perform the action `ALTER ANY PROCEDURE` on the used schema. For more information, see [Roles and privileges](https://dev-docs.nebula-graph.io/v5.3.2/server-admin/authorization/). ## Syntax diagramsource alter_procedure_statement parameter_declaration ```` alter_procedure_statement ::= 'ALTER' 'PROCEDURE' procedure_name '(' ( parameter_declaration ( ',' parameter_declaration )* )? ')' ( ('COMMENT' new_comment_string) | ('RENAME' 'TO' new_procedure_name) ) parameter_declaration ::= parameter_name? parameter_type ('DEFAULT' default_value )? ```` ## Parameters ### `procedure_name` The name of the UDP to be altered. ### `parameter_name` The name of the input parameter accepted by the UDP. ### `parameter_type` The data type of the input parameter accepted by the UDP. ### `default_value` The default value of the input parameter. ### `new_comment_string` The new description of the UDP. ### `new_procedure_name` The new name of the UDP to be altered. `procedure_name` must be an identifier. For more information about identifiers, see [Rules for naming identifiers](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/overview/keywords-identifiers/). ## Examples ### Alter the comment of a UDP ```` ''' // Create UDP `test1` CREATE OR REPLACE PROCEDURE test4(a INT, b STRING) RETURNS (x INT, y STRING) COMMENT 'test_comment_1' AS { RETURN a, b } ''' ''' ALTER PROCEDURE test4(INT, STRING) COMMENT 'test_comment_2' ''' ```` ### Alter the name of a UDP ```` ALTER PROCEDURE test4(INT, STRING) RENAME TO test44 ````