Using arrays of parameters
- Last Updated: October 12, 2022
- 1 minute read
- DataDirect Connectors
- ODBC
- IBM Db2 8.0
- Documentation
Db2 natively supports parameter arrays and the Db2 Wire Protocol driver, in turn, supports them when connected to the Db2 databases. When designing an application for performance, using native parameter arrays for bulk inserts or updates, for example, can improve performance.
Refer to Designing ODBC applications for performance optimization in the Progress DataDirect for ODBC Drivers Reference for details.
The Db2 Wire Protocol driver accepts a proprietary statement attribute called SQL_ATTR_PARAM_ARRAY_ATOMIC. It has two values: SQL_PA_ATOMIC_YES (1) and SQL_PA_ATOMIC_NO (0).
When set to SQL_PA_ATOMIC_YES, the default, parameter array operations are atomic, meaning that if one row in the parameter array fails, then the entire array must fail.
When set to SQL_PA_ATOMIC_NO, parameter array operations are not atomic, meaning that the parameter array continues to be processed, even if one of the rows fails.