Question & Answer
Question
What is SQL_ATTR_QUERY_TIMEOUT?
Answer
SQL_ATTR_QUERY_TIMEOUT is an attribute on a statement handle that allows you to set a timeout value for SQL queries ran through the ODBC API.
What it does
SQL_ATTR_QUERY_TIMEOUT tells ODBC to limit the amount of time a query can take to run. The time required to fetch the data returned by the query is not included.
What products have it
This feature is available in the IBM Informix® ODBC driver found in:
Product | Version | Operating System |
IBM Informix SDK | 2.80.xC1 or higher | All |
How to use it
Call the ODBC API function SQLSetStmtAttr and pass the SQL_ATTR_QUERY_TIMEOUT constant along with a timeout value given in seconds. A timeout value of 0 (zero) disables the timeout.
Example:
This example shows you how to set SQL_ATTR_QUERY_TIMEOUT.
SQLSetStmtAttr(hstmt, SQL_ATTR_QUERY_TIMEOUT,(SQLPOINTER)secs, SQL_IS_UINTEGER);
- hstmt
- This is a valid ODBC statement handle.
- secs
- This is a SQLUINTEGER that can be 0 or greater.
Was this topic helpful?
Document Information
More support for:
Informix Tools
Software version:
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 4.0, 4.1, 4.2, 5.1, 6.0, 7.2, 7.3
Operating system(s):
AIX, DYNIX/ptx, HP-UX, IRIX, Linux, Reliant UNIX, Solaris, Windows
Document number:
80431
Modified date:
20 January 2022
UID
swg21190442