There are many considerations to think about when you are creating
an SQL package.
CRTSQLPKG authorization
When you create an SQL package on an iSeries™ system,
the authorization ID used must have *USE authority to the CRTSQLPKG command.
Create a package on a non-DB2 UDB for iSeries
When you create a program and SQL package for a non-DB2® UDB for iSeries™,
and try to use SQL statements that are unique to that relational database,
the CRTSQLxxx GENLVL parameter should be set to 30.
Target release (TGTRLS) parameter
While creating the package, the SQL statements are checked to determine which release can support the function.
SQL statement size
The create SQL package function may not be able to handle the same size SQL statement 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 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 done for the package creation is based on the type of connect requested using 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.
Create 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 the 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.