To execute the ALTER PROCEDURE command, users must possess either overall SYSADM or SYSCTRL authority for the location, or be the owner of the stored procedure affected.
Bold text indicates clauses or options that are supported only syntactically.
ALTER PROCEDURE procedure-name [DYNAMIC RESULT {SET | SETS} integer] [EXTERNAL NAME {'string' | identifier}] [{DETERMINISTIC | NOT DETERMINISTIC}] [{CONTAINS SQL | READS SQL DATA | MODIFIES SQL DATA}] [{NO COLLID | COLLID collection-id}] [{WLM ENVIRONMENT {name | (name,*)}} | NO WLM ENVIRONMENT}] [ASUTIME {NO LIMIT | LIMIT integer}] [STAY RESIDENT {NO | YES}] [PROGRAM TYPE {SUB | MAIN}] [SECURITY {DB2 | USER | DEFINER}] [RUN OPTIONS run-time-options] [COMMIT ON RETURN {NO | YES}] [INHERIT SPECIAL REGISTERS | DEFAULT SPECIAL REGISTERS] [{STOP AFTER SYSTEM DEFAULT FAILURES | STOP AFTER integer FAILURES | CONTINUE AFTER FAILURE}]
Identifies the stored procedure to be altered. The name is implicitly or explicitly qualified by a schema name. If the name is not explicitly qualified, it is implicitly qualified with a schema name according to the following rules.
Specifies the maximum number of query result sets that the stored procedure can return. The value must be between 0 and 32767.
Specifies the name of the MVS load module for the program that runs when the procedure name is specified in an SQL CALL statement. The value must conform to the naming conventions for MVS load modules: the value must be less than or equal to 8 bytes, and it must conform to the rules for an ordinary identifier with the exception that it must not contain an underscore.
Specifies whether the stored procedure returns the same result from successive calls with identical input arguments.
NOT DETERMINISTIC | The stored procedure might not return the same result from successive calls with identical input arguments. |
DETERMINISTIC | The stored procedure returns the same result from successive calls with identical input arguments.
XDB does not verify that the stored procedure code is consistent with the specification of DETERMINISTIC or NOT DETERMINISTIC. |
Indicates whether the stored procedure can execute any SQL statements and, if so, what type.
MODIFIES SQL DATA | The stored procedure can execute any SQL statement except those statements that are not supported in any stored procedure. |
READS SQL DATA | The stored procedure cannot execute SQL statements that modify data. SQL statements that are not supported in any stored procedure return a different error. |
CONTAINS SQL | The stored procedure cannot execute any SQL statements that read or modify data. SQL statements that are not supported in any stored procedure return a different error |
Identifies the package collection that is used when the stored procedure is executed.
NO COLLID | The package collection for the stored procedure is the same as the package collection of the program that invokes the stored procedure. If a trigger invokes the stored procedure, the collection of the trigger package is used. If the invoking program does not use a package, XDB resolves the package by using the CURRENT PACKAGE PATH special register or the CURRENT PACKAGESET special register. |
COLLID collection-id | The name of the package collection that is used when the stored procedure is executed. |
Specifies the total amount of processor time, in CPU service units, that a single invocation of a stored procedure can run. The value is unrelated to the ASUTIME column of the resource limit specification table.
When you are debugging a stored procedure, setting a limit can be helpful in case the stored procedure gets caught in a loop.
The XDB Server operating environment only provides NO LIMIT at this time.
Specifies whether the stored procedure load module remains resident in memory when the stored procedure ends.
The XDB Server provides an operating environment where the function does not remain resident.
This clause has no functional equivalent in the XDB Server operating environment.
Indicates whether XDB commits the transaction immediately on return from the stored procedure.
Any changes that the ALTER PROCEDURE statement cause to the definition of a procedure take effect immediately.
The changed definition is used the next time that the procedure is called.
A stored procedure, user-defined function, or trigger cannot call a stored procedure that is defined with the COMMIT ON RETURN clause.