The SET CURRENT PACKAGESET statement sets the schema name (collection identifier) that will be used to select the package to use for subsequent SQL statements. This statement is not under transaction control.
Invocation
This statement can be embedded only in an application program. It is an executable statement that cannot be dynamically prepared. This statement is not supported in REXX.
Authorization
None required.
Syntax
.-=-. >>-SET--CURRENT PACKAGESET--+---+----+-string-constant-+------->< '-host-variable---'
Description
Notes
Example
Assume an application called TRYIT is precompiled by userid PRODUSA, making 'PRODUSA' the default schema name in the bind file. The application is then bound twice with different bind options. The following command line processor commands were used:
DB2 CONNECT TO SAMPLE USER PRODUSA DB2 BIND TRYIT.BND DATETIME USA DB2 CONNECT TO SAMPLE USER PRODEUR DB2 BIND TRYIT.BND DATETIME EUR COLLECTION 'PRODEUR'
This creates two packages called TRYIT. The first bind command created the package in the schema named 'PRODUSA'. The second bind command created the package in the schema named 'PRODEUR' based on the COLLECTION option.
Assume the application TRYIT contains the following statements:
EXEC SQL CONNECT TO SAMPLE; . . EXEC SQL SELECT HIREDATE INTO :HD FROM EMPLOYEE WHERE EMPNO='000010'; (1) . . EXEC SQL SET CURRENT PACKAGESET 'PRODEUR'; (2) . . EXEC SQL SELECT HIREDATE INTO :HD FROM EMPLOYEE WHERE EMPNO='000010'; (3)