Syntax

ALTER PROCEDURE procedure_name options [RESTRICT]

Description

You can use the ALTER PROCEDURE command to specify whether a stored procedure is a 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 and 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 and is ignored.

The RESTRICT keyword is supported for compatibility and can be 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;