Considerations for creating an SQL package
When you create an SQL package, consider these aspects.
- CRTSQLPKG authorization
When you create an SQL package on the i5/OS operating system, the authorization ID used must have *USE authority to the Create SQL Package (CRTSQLPKG) command.
- Creating a package on a database other than DB2 UDB for iSeries
When you create a program or an SQL package on a database other than DB2® UDB for iSeries™, and try to use SQL statements that are unique to the other database, set the GENLVL parameter on the Create SQL (CRTSQLxxx) commands to 30.
- Target release (TGTRLS) parameter
When you create the package, the SQL statements are checked to determine which release can support the function.
- SQL statement size
The create SQL package function might not be able to handle an SQL statement of the same size that the precompiler can process.
- Statements that do not require a package
In some cases, you might try to create an SQL package, but the SQL package is not created and the program still runs. This situation occurs when the program contains only SQL statements that do not require an SQL package to run.
- Package object type
SQL packages are always created as non-ILE objects and always run in the default activation group.
- ILE programs and service programs
ILE programs and service programs that bind several modules containing SQL statements must have a separate SQL package for each module.
- Package creation connection
The type of connection used for the package creation is based on the type of connection specified by the RDBCNNMTH parameter.
- Unit of work
Because package creation implicitly performs a commit or rollback, the commit definition must be at a unit of work boundary before the package creation is attempted.
- Creating packages locally
The name specified on the RDB parameter can be the name of the local system.
- Labels
You can use the LABEL ON statement to create a description for an SQL package.
- Consistency token
The program and its associated SQL package contain a consistency token that is checked when a call is made to the SQL package.
- SQL and recursion
If you start SQL from an attention key program while you are already precompiling, you will receive unpredictable results.
Parent topic:
SQL package support