DB2 Version 9.7 for Linux, UNIX, and Windows

Upgrade impact from DB2 API changes

The changes in DB2® Version 9.7 to DB2 APIs can impact your existing applications after you upgrade to DB2 Version 9.7.

The changes to DB2 APIs include new parameters, modifications to existing parameters, and deprecated or discontinued APIs. The following table lists the changes that impact your existing applications:
Table 1. Changes to DB2 APIs
DB2 API Summary of changes with upgrade impact
db2DatabaseUpgrade This API upgrades a pre-Version 9.7 DB2 database to the current release. It uses the new db2DatabaseUpgradeStruct structure as parameter. Use this API instead of the sqlemgdb or sqlgmgdb API.
db2Export, db2Import, or db2Load Due to changes in the DB2 authorization model, the SYSADM group is no longer authorized to run these APIs and the DBADM authority no longer provides access to data. The new DATAACCESS authority now provides access to data. The UPGRADE DATABASE command grants DBADM authority to the SYSADM group and grants DATAACCESS authority to users holding DBADM authority including the SYSADM group so that there is no upgrade impact. However, for these APIs, you should review all of the changes in authorization and grant required authorization to users.

If you create databases in DB2 Version 9.7, grant the required authorization to users that need to run these APIs. You can grant DBADM authority to the SYSADM group and grant DATAACCESS authority to users holding DBADM authority to maintain the same authorization as in previous releases.

The CREATE and REPLACE_CREATE parameters of the IMPORT command are deprecated. Use DDL scripts that you developed or generated with the db2look command to create the table before you call the db2Import API specifying another supported parameter in the action string such as INSERT, INSERT_UPDATE, or REPLACE.

db2GetDistMap Due to the size increase of the distribution map from 4 096 to 32 768 entries, use this new API to read the distribution map. This API requires the new db2DistMapStruct structure as parameter. Read the row in this table for the sqlugtpi API for more details.
db2GetRowPartNum Due to the size increase of the distribution map from 4 096 to 32 768 entries, use this new API to read database partition number and database partition server number for a row. This API requires the new db2RowPartNumStruct structure as parameter. Read the row in this table for the sqlugrpn API for more details.
db2HistoryGetEntry A log sequence number (LSN) now uses 8 bytes. Therefore, every occurrence of the SQLU_LSN datatype in the db2HistoryData structure has been replaced with the new db2LSN datatype. After upgrading your DB2 servers and clients to Version 9.7, calls to this API in your applications continue to work until the value of the LSN exceeds the 6-byte maximum limit for pre-Version 9.7 releases. If the LSN reaches the 6-byte limit, you will receive the SQL2032N error message.

Modify your application code to read the new db2LSN datatype in the modified structure and rebuild your applications using the DB2 Version 9.7 libraries before the LSN reaches the maximum limit. Refer to Log sequence number changes affecting API and application behavior for details.

db2Prune Although there are no changes to the db2PruneStruct structure, if you call this API with the piString field of this structure pointing to a string representing an LSN, the length of the LSN string can now be variable and have a maximum length of 16 characters excluding the NULL terminator. In previous releases, the LSN string was exactly 12 characters in size excluding the NULL terminator. Modify your application code to increase the maximum length for an LSN string and rebuild your applications using the DB2 Version 9.7 libraries. Also, use the new db2LsnToString API for conversions between the db2LSN structure and the LSN string.
db2Runstats, sqlabndx, sqlaprep, or sqlarbnd Due to changes in the DB2 authorization model, the SYSADM group is no longer authorized to run these APIs. The UPGRADE DATABASE command grants DBADM authority to the SYSADM group so that there is no upgrade impact. However, for these APIs, you should review all of the changes in authorization and grant required authorization to users.

If you create databases in DB2 Version 9.7, grant the required authorization to users that need to run these APIs. You can grant DBADM authority to the SYSADM group to maintain the same authorization as in previous releases.

db2ReadLog and db2ReadLogNoConn An LSN now uses 8 bytes. Therefore, every occurrence of the SQLU_LSN datatype in the db2ReadLogStruct, db2ReadLogInfoStruct, db2ReadLogNoConnStruct, and db2ReadLogNoConnInfoStruct structures has been replaced with the new db2LSN datatype. If you call any of these APIs in your applications, modify your application code to read the new db2LSN datatype in these modified structures and rebuild your applications using the DB2 Version 9.7 libraries before upgrading your DB2 servers and clients. Refer to Log sequence number changes affecting API and application behavior for details.

If you set the iFilterOption parameter to DB2READLOG_FILTER_ON when you call the db2ReadLog API in your applications, modify your application code to read the new db2ReadLogFilterData structure that is prefixed to log records. If you set the iFilterOption parameter to DB2READLOG_FILTER_OFF, although log records continue to be prefixed with an LSN as in previous releases, modify your application code to read the new db2LSN datatype.

Db2Reorg The db2ReorgStruct structure has been modified to support partitioned indexes. A new pPartitionName field to indicate a data partition name has been added to the db2ReorgTable and db2ReorgIndexesAll structures. Depending on the value of the versionNumber field, a new partitionNameLen field has also been added to indicate the length inn bytes of pPartitionName. Although the value of this parameter is only considered when the DB2REORG_ON_DATA_PARTITION flag is specified, rebuild your applications using the DB2 Version 9.7 libraries to start using the modified structure.
db2Runstats When you call this API to update statistics on tables with LOB columns, statistics for the average length of column and number of NULLs in a column are now collected.

Refer to the db2Runstats API row for additional authorization changes that also apply to this API.

sqlbctsq, sqlbgtss, sqlbotsq, and sqlbtcq These APIs and related SQLB_TBSPQRY_DATA data structure have been deprecated and might be removed in a future release. Start using queries with the MON_GET_TABLESPACE or the MON_GET_CONTAINER table functions instead. These table functions return more information than was provided by the deprecated APIs.
sqlbftpq, sqlbmtsq, and sqlbstpq The data type for the lifeLSN field in the SQLB_TBSPQRY_DATA structure has changed to sqluint64 from char[6]. Calls to this API in your applications continue to work after upgrading your DB2 servers and clients until the value of the LSN exceeds the 6-byte maximum limit. Modify your application code to read the sqluint64 datatype in this modified structure and rebuild your applications using the DB2 Version 9.7 libraries before you reach this maximum limit.

These APIs and related SQLB_TBSPQRY_DATA data structure have been deprecated and might be removed in a future release. Start using queries with the MON_GET_TABLESPACE or the MON_GET_CONTAINER table functions instead. These table functions return more information than was provided by the deprecated APIs.

sqlbstsc You can now use this API to enable automatic storage for table spaces. All existing containers are redefined to use the storage paths defined in the database. A value of 0 for the NumContainers parameter along with a NULL value for the pContainerData parameter enables the table space for automatic storage.
sqlecrea For new databases created on DB2 Version 9.7, the new cur_commit configuration parameter is set to ON so that currently committed semantics is enabled on cursor stability scans. A returned result set operating under cursor stability isolation level set might be different than in previous releases. Refer to Currently committed semantics improve concurrency for details on how currently committed behavior works.
sqlemgdb and sqlgmgdb These APIs are deprecated. Use the new db2DatabaseUpgrade API.
sqluadau The sqluadau API is discontinued in DB2 Version 9.7. Use the AUTH_LIST_AUTHORITIES_FOR_AUTHID table function to get the information that the sqluadau API provided.
sqlugtpi Starting with DB2 Version 9.7, this API is deprecated. If you set the DB2_PMAP_COMPATIBILITY registry variable to OFF and you call this API, you will receive the SQL2768N error message because of the size increase of the distribution map to 32 768 entries. Use the new db2GetDistMap API.
sqlurlog If you call this API from an application running on a pre-Version 9.7 client that connects to a Version 9.7 database, you will receive the SQL1198N error message. Calls to the sqlurlog API from an application running on a Version 9.7 client that connects to a Version 9.7 database, continue to work until the value of the LSN exceeds the 6-byte maximum limit for pre-Version 9.7 releases. If the LSN reaches this 6-byte limit, you will receive the SQL2650N error message
sqlugrpn Starting with DB2 Version 9.7, this API is deprecated. If you set the DB2_PMAP_COMPATIBILITY registry variable to OFF and you call this API, you will receive the SQL2768N error message because of the size increase of the distribution map to 32 768 entries. Use the new db2GetRowPartNum API to read the database partition number and database partition server number for a row. See DB2_PMAP_COMPATIBILITY in Table 1 for details.