Product Documentation

FairCom Direct SQL for C and C++

Previous Topic

Next Topic

ctsqlSetTimeout

Declaration

CTSQLRET ctsqlDECL ctsqlSetTimeout(pCTSQLCMD hCmd, INTEGER timeout);

Description

ctsqlSetTimeout() sets the timeout value associated with the command handle.

FairCom DB SQL supports a timeout option for executing a query. This feature can ensure that an unintended query statement does not consume excessive processing time of FairCom DB SQL.

  • hCmd a command handle.
  • timeout the timeout value in seconds. A value of zero clears the timeout, indicating that the execution of a FairCom DB SQL query will not timeout. To take effect, the timeout value should be set before preparing the statement by calling ctsqlPrepare(). Should you need to change the timeout value of a command handle, set the new timeout value, or set to zero to clear the timeout value, and prepare the statement again.

Negative values are not accepted and will generate a CTSQLRET_BADARG error.

Return Values

ctsqlSetTimeout() returns CTSQLRET_OK on success.

Symbolic Constant

Explanation

SQL_ERR_BADARG

Bad arguments

See Also

ctsqlSetTimeout()

TOCIndex