ALTER PROCEDURE statement
The ALTER PROCEDURE statement defines changes to a stored procedure.

ALTER PROCEDURE procedureOwner.procedureSchema.procedureName | This option specifies the fully qualified name of the procedure. | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
VERSION versionNumber | This option specifies the version of the procedure. | ||||||||||||||
PARAMETERS (ordinality, parmUsage, parmName, dataType, subType, locator) | This option specifies the parameters for a procedure. Procedure parameters values
| ||||||||||||||
ACTIVE | This option indicates whether to activate the version of the procedure. ACTIVE keyword values
| ||||||||||||||
APPLCOMPAT | This option indicates the package compatibility level for SQL. APPLCOMPAT keyword values
| ||||||||||||||
APPLICATION_ENCODING_SCHEME | This option specifies the encoding scheme for the procedure. APPLICATION_ENCODING_SCHEME keyword values
| ||||||||||||||
ARCHIVE SENSITIVE | This option specifies whether references to archive-enabled tables in SQL statements are affected by the value of the SYSIBMADM.GET_ARCHIVE global variable. The following table lists valid values for the ARCHIVE SENSITIVE keyword. ARCHIVE SENSITIVE keyword values
| ||||||||||||||
BUSINESS_TIME SENSITIVE | This option specifies whether references to application-period temporal tables in both static and dynamic SQL statements are affected by the value of the CURRENT TEMPORAL BUSINESS_TIME special register. BUSINESS_TIME SENSITIVE keyword values
| ||||||||||||||
ASUTIME n | This option specifies the number of CPU service units for the procedure. A value of 0 indicates that no limit exists on the number of units. | ||||||||||||||
COLLID | This option specifies the name of the package collection for the procedure. (The name of this collection is stored in the SYSIBM.SYSROUTINES table.) COLLID keyword values
| ||||||||||||||
COMMENT | This option specifies the comments for a procedure. COMMENT keyword values
| ||||||||||||||
COMMIT_ON_RETURN NO | This option specifies that Db2 should continue the unit of work | ||||||||||||||
COMMIT_ON_RETURN YES | This option specifies that Db2 should commit the unit of work immediately. | ||||||||||||||
AUTONOMOUS | For native SQL procedures, this option specifies that Db2 should execute the SQL procedure in a unit of work that is independent from the calling application. | ||||||||||||||
CONCURRENT_ACCESS_RESOLUTION | This option specifies the concurrent access resolution option to use for statements in a package. CONCURRENT_ACCESS_RESOLUTION keyword values
| ||||||||||||||
CURRENT_DATA | This option indicates whether to require data currency for cursors when the isolation level of cursor stability is in effect. CURRENT_DATA keyword values
|

DATE_FORMAT | This option specifies the format for the date for the procedure. DATE_FORMAT keyword values
| ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DBINFO | This option indicates whether to pass the DBINFO structure to the stored procedure. DBINFO keyword values
| ||||||||||||||
DEBUG_MODE | This option specifies whether the procedure is allowed for debugging. DEBUG_MODE keyword values
| ||||||||||||||
DECIMAL | This option specifies the rules for a decimal operation (DEC31 or DEC15). DECIMAL keyword values
| ||||||||||||||
DEFER_PREPARE | This option indicates whether to immediately prepare dynamic SQL statements or to defer preparation. DEFER_PREPARE keyword values
| ||||||||||||||
DEGREE | This option specifies whether to attempt to run a query using parallel processing. DEGREE keyword values
| ||||||||||||||
DETERMINISTIC | This option indicates whether to use indeterminate or deterministic results for a procedure. DETERMINISTIC keyword values
| ||||||||||||||
DYNAMICRULES | This option specifies the values for the dynamic SQL attributes. DYNAMICRULES keyword values
| ||||||||||||||
EXPLAIN | This option indicates whether to add information about the package’s statements to the owner of the PLAN_TABLE table. EXPLAIN keyword values
|

EXTERNAL_NAME externalName JAVAExternalName | This option specifies the module that Db2 should load to execute the procedure. For parameters for a JAVAExternalName, see JAVAExternalName. | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
IMMEDIATE_WRITE | This option indicates whether updates that are made to dependent page sets for group buffer pools should be immediately written. IMMEDIATE_WRITE keyword values
| ||||||||||||||||
ISOLATION_LEVEL | This option specifies the isolation level. ISOLATION_LEVEL keyword values
| ||||||||||||||||
KEEP_DYNAMIC | This option indicates whether dynamic SQL statements are purged at each commit point. KEEP_DYNAMIC keyword values
| ||||||||||||||||
LANGUAGE | This option specifies the implementation language of the procedure. LANGUAGE keyword values
| ||||||||||||||||
MAXIMUM_FAILURES |
This option specifies the number of allowable failures for the procedure. MAXIMUM_FAILURES keyword values
| ||||||||||||||||
OPTHINT | This option specifies the value of the query optimization hint bind option. OPTHINT keyword values
| ||||||||||||||||
OWNER authorizationID | This option specifies the owner of the procedure. The OWNER parameter is included in the CDL statement only if the OVERRIDE( SPOWNER ) keyword is in the ALUIN input stream. When the procedure is a JAVA procedure, JAVAExternalName uses the parameters shown in JAVAExternalName. | ||||||||||||||||
PACKAGE_OWNER | This option specifies the owner of the package. PACKAGE_OWNER keyword values
| ||||||||||||||||
PACKAGE_PATH | This option specifies the package path to use when the procedure executes. PACKAGE_PATH keyword values
| ||||||||||||||||
PARAMETER_CCSID | This option specifies the encoding scheme for the parameters for the procedure. PARAMETER_CCSID keyword values
| ||||||||||||||||
PARAMETER_STYLE | This option specifies the convention used to pass parameters to and return values from the procedure. PARAMETER_STYLE keyword values
|

JAR_SCHEMA schema | This option specifies the schema of the JAR file. |
|---|---|
JAR_ID name | This option specifies the name of the JAR file. |
EXTERNAL_NAME name | This option specifies the package.class.method that Db2 should load to execute the JAVA procedure. |
JAVASIGNATURE signature | This option specifies the signature of the JAR file. |

PARAMETER_VARCHAR | This option specifies the representation of variable length string parameters. PARAMETER_VARCHAR keyword values
| ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PROGRAM_TYPE | This option indicates whether the procedure runs as a main routine or a subroutine. PROGRAM_TYPE keyword values
| ||||||||||||||||||
QUALIFIER | This option specifies the implicit qualifier for the unqualified object names in the SQL statements. QUALIFIER keyword values
| ||||||||||||||||||
RELEASE_AT | This option specifies the release resources when the package was last bound or rebound. RELEASE_AT keyword values
| ||||||||||||||||||
RESULT_SETS value | This option specifies the number of query result sets that the procedure can return. Values are 0 through 32767. | ||||||||||||||||||
REOPT | This option specifies whether to have Db2 determine an access path at run time. REOPT keyword values
| ||||||||||||||||||
ROUNDING | This option specifies the rounding mode when the package is bound. ROUNDING keyword values
| ||||||||||||||||||
RUN_OPTIONS | This option specifies the language environment run-time options for the procedure. RUN_OPTIONS keyword values
| ||||||||||||||||||
SECURITY | If the procedure accesses resources that are protected by an external security product, specifies the authorization ID. SECURITY keyword values
| ||||||||||||||||||
SPECIAL_REGISTERS | This option specifies how special registers are set. SPECIAL_REGISTERS keyword values
| ||||||||||||||||||
SQL_DATA_ACCESS | This option specifies which SQL statements can be executed in the procedure. SQL_DATA_ACCESS keyword values
|

SQL_PATH | This option specifies the SQL path that Db2 uses to resolve unqualified types and names in the procedure. SQL_PATH keyword values
| ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
STAY_RESIDENT | This option indicates whether the procedure load module remains resident in memory when the procedure ends. STAY_RESIDENT keyword values
| ||||||||||||||
SYSTEM_TIME SENSITIVE | This option indicates whether references to system-period temporal tables in both static and dynamic SQL statements are affected by the value of the CURRENT TEMPORAL SYSTEM_TIME special register. SYSTEM_TIME SENSITIVE keyword values
| ||||||||||||||
TIME_FORMAT | This option specifies the time format for values. TIME_FORMAT keyword values
| ||||||||||||||
FOR_UPDATE_CLAUSE | This option specifies whether the FOR UPDATE clause is required or optional for a DECLARE CURSOR statement. FOR_UPDATE_CLAUSE keyword values
| ||||||||||||||
VALIDATE | This option specifies whether to recheck errors. VALIDATE keyword values
| ||||||||||||||
WLM_ENVIRONMENT | This option specifies the workload manager (WLM) environment in which the procedure runs. WLM_ENVIRONMENT keyword values
| ||||||||||||||
WLM_ENV_FOR_NESTED | For nested procedures, this option indicates which address space Db2 uses. WLM_ENV_FOR_NESTED keyword values
| ||||||||||||||
TEXT storedProcedureBody | This option specifies the statements in the body of the SQL procedure. |
Related topic