IBM Support

Return Code for Unusable Package Setting

Troubleshooting


Problem

This document explains how iSeries Access for Windows ODBC driver uses the "return code for unusuable package" setting.

Resolving The Problem

The iSeries Access for Windows ODBC driver has a Datasource (DSN) setting that controls how extended dynamic package errors are reported to the application. This is the Return code for unusable Package setting. The possible values are Error, Warning, and Ignore.

With V5R1 and later of iSeries Access for Windows ODBC, packages are created and opened on the first prepare of an SQL statement rather than when the application connects.

If a error occurs involving the package, the error returned is based on the unusable package setting. If the value is Error, SQL_ERROR is returned and the SQL statement is not run. If the value is Warning, a SQL_SUCCESS_WITH_INFO is returned. If the value is Ignore, SQL_SUCCESS is returned. Error messages that describe the error are available for Error and Warning settings.

At Service Pack level SI01907 (V5R1) and earlier, this setting applied only to unusable packages. A typical example of an unusable package is an existing package with a different default collection. If an error occurred creating a package, an SQL_ERROR was always returned regardless of the package error setting. A typical example of a package creation error is a user not having object creation authority to the package library. Later versions of iSeries Access for Windows ODBC extended the definition of unusable to apply to all package errors including creation errors.

Note: Any error or warning is reported only on the first prepare. All later prepares and executes run as usual regardless of the setting. Applications that wish to monitor and handle package creation errors should do so on the first SQL statement that is run. The programmer may even want to prepare a dummy SQL statement if special handling of extended dynamic support is required.

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Data Access","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Historical Number

24882225

Document Information

Modified date:
18 December 2019

UID

nas8N1017204