IBM Books

Embedded SQL Programming Guide


Precompiling

There are some differences in the precompilers for different IBM relational database systems. The precompiler for DB2 Universal Database differs from the DRDA server precompilers in the following ways:

Blocking

The DB2 Connect program supports the DB2 blocking bind options:

UNAMBIG
Only unambiguous cursors are blocked (the default).
ALL
Ambiguous cursors are blocked.
NO
Cursors are not blocked.

The DB2 Connect program uses the block size defined in the DB2 configuration file for the RQRIOBLK field. Current versions of DRDA supports block sizes up to 32 767. If larger values are specified in the DB2 configuration file, DB2 Connect uses a value of 32 767 but does not reset the DB2 configuration file. Blocking is handled the same way using the same block size for dynamic and static SQL.
Note:Most DRDA server systems consider dynamic cursors ambiguous, but DB2 Universal Database systems consider some dynamic cursors unambiguous. To avoid confusion, you can specify BLOCKING ALL with DB2 Connect.

Specify the block size in the DB2 configuration file by using the CLP, the Control Center, or an API, as listed in the API Reference and Command Reference.

Package Attributes

A package has the following attributes:

Collection ID
The ID of the package. It can be specified on the PREP command.

Owner
The authorization ID of the package owner. It can be specified on the PREP or BIND command.

Creator
The user name that binds the package.

Qualifier
The implicit qualifier for objects in the package. It can be specified on the PREP or BIND command.

Each DRDA server system has limitations on the use of these attributes:

DB2 for MVS/ESA and DB2 for OS/390
All four attributes can be different. The use of a different qualifier requires special administrative privileges.

DB2 for VSE & VM
All of the attributes must be identical. If USER1 creates a bind file (with PREP), and USER2 performs the actual bind, USER2 needs DBA authority to bind for USER1. Only USER1's user name is used for the attributes.

DB2 for AS/400
The qualifier indicates the collection name. The relationship between qualifiers and ownership affects the granting and revoking of privileges on the object. The user name that is logged on is the creator and owner unless it is qualified by a collection ID, in which case the collection ID is the owner. The collection ID must already exist before it is used as a qualifier.

DB2 Universal Database
For DB2 Universal Database databases, the collection ID and the creator can be different. The creator also becomes the owner and the qualifier of the package.
REFID='T4'.
Note:DB2 Connect provides support for the SET CURRENT PACKAGESET command for DB2 for MVS/ESA, DB2 for OS/390, and DB2 Universal Database.

C Null-terminated Strings

The CNULREQD bind option overrides the handling of null-terminated strings that are specified using the LANGLEVEL option. See "Null-terminated Strings" for a description of how null-terminated strings are handled when prepared with the LANGLEVEL option set to MIA or SAA1. By default, CNULREQD is set to YES. This causes null-terminated strings to be interpreted according to MIA standards. If connecting to a DB2 for OS/390 server it is strongly recommended to set CNULREQD to YES. DB2 Connect will use CNULREQD as a default. You need to bind applications coded to SAA1 standards (with respect to null-terminated strings) with the CNULREQD option set to NO. Otherwise, null-terminated strings will be interpreted according to MIA standards, even if they are prepared using LANGLEVEL set to SAA1.

Standalone SQLCODE and SQLSTATE

Standalone SQLCODE and SQLSTATE variables, as defined in ISO/ANS SQL92, are supported through the LANGLEVEL SQL92E precompile option. An SQL0020W warning will be issued at precompile time, indicating that LANGLEVEL is not supported. This warning applies only to the features listed under LANGLEVEL MIA in the Command Reference, which is a subset of LANGLEVEL SQL92E.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]