ALTER PROCEDURE Statement

Replaces an existing procedure with a modified version. Include the entire modified procedure in the ALTER PROCEDURE statement, and reassign user permissions on the procedure.

Quick Links:

Go to Parameters

Go to Usage

Go to Standards

Go to Permissions

Syntax

Syntax 1

ALTER PROCEDURE [ owner.]procedure-name procedure-definition

Syntax 2

ALTER PROCEDURE [ owner.]procedure-name
   REPLICATE {  ON | OFF  }

Syntax 3

ALTER PROCEDURE [ owner.]procedure-name
   SET HIDDEN

Syntax 4

ALTER PROCEDURE [ owner.]procedure-name
   RECOMPILE

Syntax 5

ALTER PROCEDUREowner.]procedure-name ( [ parameter, …] )
   [ RESULT (result-column, ...)]
   EXTERNAL NAMEexternal-call’ [ LANGUAGE JAVA [ environment-name ] }

external-call - (back to Syntax 5)
   [column-name:]function-name@library; ...

environment-name - (back to Syntax 5)
   DISALLOW | ALLOW SERVER SIDE REQUESTS

Parameters

(back to top)

Usage

(back to top)

The ALTER PROCEDURE statement must include the entire new procedure. You can use PROC as a synonym for PROCEDURE. Both Watcom and Transact-SQL® dialect procedures can be altered through the use of ALTER PROCEDURE. Existing permissions on the procedure are not changed. If you execute DROP PROCEDURE followed by CREATE PROCEDURE, execute permissions are reassigned.

You cannot combine Syntax 2 with Syntax 1.

When using the ALTER PROCEDURE statement for table UDFs, the same set of restrictions apply as for the CREATE PROCEDURE Statement (External Procedures).

Standards

(back to top)

  • SQL—Vendor extension to ISO/ANSI SQL grammar.
  • SAP Sybase Database product—Not supported by SAP Adaptive Server® Enterprise.

Permissions

(back to top)

Alter a Watcom-SQL or Transcat-SQL procedure – Requires one of:
  • ALTER ANY PROCEDURE system privilege.
  • ALTER ANY OBJECT system privilege.
  • You own the procedure.
Alter an external C/C++ or external environment procedure – Requires CREATE EXTERNAL REFERENCE system privilege. Also requires one of:
  • ALTER ANY PROCEDURE system privilege.
  • ALTER ANY OBJECT system privilege.
  • You own the procedure.
Related concepts
Table UDF Restrictions
Related reference
CREATE PROCEDURE Statement (Table UDF)