Statement handle allocation
A statement handle refers to the data object that describes and tracks the execution of an SQL statement. You must allocate a statement handle before you can execute a statement.
SQLAllocHandle()
(with HandleType set
to SQL_HANDLE_STMT) allocates a statement handle to describe an SQL
statement. The description of an SQL statement includes information
such as statement attributes, SQL statement text, dynamic parameters,
cursor information, bindings for dynamic arguments and columns, result
values, and status information (these are discussed later). Each statement
handle associates the statement it describes with a connection.
By default, the maximum number of statement handles you can allocate
at any one time is limited by the application heap size. The maximum
number of statement handles you can actually use, however, is defined
by Db2 ODBC. Table 1 lists the number of statement
handles Db2 ODBC allows for
each isolation level. If an application exceeds these limits,
SQLPrepare()
and SQLExecDirect()
return
SQLSTATE HY014.
Isolation level | Without hold | With hold | Total |
---|---|---|---|
Cursor stability | 296 | 254 | 550 |
No commit | 296 | 254 | 550 |
Repeatable read | 296 | 254 | 550 |
Read stability | 296 | 254 | 550 |
Uncommitted read | 296 | 254 | 550 |