DYNAMICRULES bind option
The DYNAMICRULES bind option and the run time environment determine the values for the dynamic SQL attributes.
- The authorization ID that is used to check authorization
- The qualifier that is used for unqualified objects
- The source for application programming options that DB2® uses to parse and semantically verify dynamic SQL statements
- Whether dynamic SQL statements can include GRANT, REVOKE, ALTER, CREATE, DROP, and RENAME statements
- The package runs as part of a stand-alone program.
- The package runs as a stored procedure or user-defined function
package, or it runs under a stored procedure or user-defined function.
A package that runs under a stored procedure or user-defined function is a package whose associated program meets one of the following conditions:
- The program is called by a stored procedure or user-defined function.
- The program is in a series of nested calls that start with a stored procedure or user-defined function.
Dynamic SQL statement behavior:
- Run behavior
- Bind behavior
- Define behavior
- Invoke behavior
The following table shows the combination of DYNAMICRULES value and run time environment that yield each dynamic SQL behavior.
DYNAMICRULES value | Behavior of dynamic SQL statements in a stand-alone program environment | Behavior of dynamic SQL statements in a user-defined function or stored procedure environment |
---|---|---|
BIND | Bind behavior | Bind behavior |
RUN | Run behavior | Run behavior |
DEFINEBIND | Bind behavior | Define behavior |
DEFINERUN | Run behavior | Define behavior |
INVOKEBIND | Bind behavior | Invoke behavior |
INVOKERUN | Run behavior | Invoke behavior |
Note: The BIND and RUN values can be
specified for packages and plans. The other values can be specified
only for packages.
|
The following table shows the dynamic SQL attribute values for each type of dynamic SQL behavior.
Dynamic SQL attribute | Setting for dynamic SQL attributes | |||
---|---|---|---|---|
Bind behavior | Run behavior | Define behavior | Invoke behavior | |
Authorization ID | Plan or package owner | Current SQLID | User-defined function or stored procedure owner | Authorization ID of invoker1 |
Default qualifier for unqualified objects | Bind OWNER or QUALIFIER value | CURRENT SCHEMA | User-defined function or stored procedure owner | Authorization ID of invoker |
CURRENT SQLID2 | Not applicable | Applies | Not applicable | Not applicable |
Source for application programming options | Determined by DSNHDECP or a user-specified application defaults module parameter DYNRULS3 | Install panel DSNTIP4 | Determined by DSNHDECP or a user-specified application defaults module parameter DYNRULS3 | Determined by DSNHDECP or a user-specified application defaults module parameter DYNRULS3 |
Can execute GRANT, REVOKE, CREATE, ALTER, DROP, RENAME? | No | Yes | No | No |
Notes:
|