Previous Topic Next topic Print topic


UDB-VERSION DB2 Directive Option

The DB2 ECM can use one of two sets of API calls, depending on the version of DB2 Database for Linux, UNIX and Windows (DB2 LUW) you are using. The set of calls used for DB2 LUW Version 7.1 and later make use of the new facilities that IBM introduced in Version 7. In this version, IBM changed the size of the program identifier string (PID) from 40 bytes to 162 bytes. The PID is stored in each application program when it is compiled. You need to use the new PID structure if you use a COLLECTION-ID greater than 8 characters.

The DB2 ECM automatically tries to use the newer set of calls if you connect to a DB2 LUW server at Version 7.1 or later when you compile your program. However, you might want to use the newer set of calls in other circumstances, for example, if you are not using Version 7.1 client software, or if you are connected to another DB2 server via DB2 Connect. To do this, use the DB2 Compiler directive UDB-VERSION, which allows you to indicate which DB2 LUW version you want to use. Valid values are V6, V7, V8, V9, V95, and V97. If you specify V7 or later, the ECM makes the new calls. For example:

DB2(UDB-VERSION=V7)

If the DB2 ECM fails to find the new API, it displays the following message:

* critical errror - DB2Initialize API not found
* Try using directive DB2(UDB-VERSION=V6)
* to compile program

followed by the message:

** DB00010 DB2 rejected an unspecified option. This error 
** prevents SQL processing from continuing - further 
** EXEC SQL statements will be ignored
Previous Topic Next topic Print topic