This topic describes the ALTER PROCEDURE command and how to use this command.

Syntax

ALTER PROCEDURE procedure_name options [RESTRICT]

Description

You can execute the ALTER PROCEDURE statement to specify whether a stored procedure is SECURITY INVOKER or SECURITY DEFINER.

Parameters

Parameter Description
procedure_name The name of the stored procedure. The name can be schema-qualified.
options
  • [EXTERNAL] SECURITY DEFINER

    Specifies that the server runs the stored procedure by using the privileges of the user who has created the stored procedure. The EXTERNAL keyword is supported for compatibility, but it is ignored.

  • [EXTERNAL] SECURITY INVOKER

    Specifies that the server runs the stored procedure by using the privileges of the user who is calling the stored procedure. The EXTERNAL keyword is supported for compatibility, but it is ignored.

The RESTRICT keyword is supported for compatibility, but it is ignored.

Examples

The following command specifies that the server runs the update_balance stored procedure by using the privileges of the user who is calling the stored procedure.

ALTER PROCEDURE update_balance SECURITY INVOKER;