Set the number of seconds that DB-Library will wait for a server response to a SQL command.
RETCODE dbsettime(seconds) int seconds;
The timeout value—the number of seconds that DB-Library waits for a server response before timing out. A timeout value of 0 represents an infinite timeout period.
SUCCEED or FAIL.
This routine sets the length of time in seconds that DB-Library will wait for a server response during calls to dbsqlexec, dbsqlok, dbresults, and dbnextrow. The default timeout value is 0, which represents an infinite timeout period.
dbsettime can be called at any time during the application—before or after a call to dbopen. It takes effect immediately upon being called.
To set a timeout value for calls to dbopen, use dbsetlogintime.
Note that, after sending a query to the server, dbsqlexec waits until a response is received or until the timeout period has elapsed. To minimize the time spent in DB-Library waiting for a response from the server, an application can instead call dbsqlsend, followed by dbsqlok.
The program can call DBGETTIME to learn the current timeout value.
A timeout generates the DB-Library error “SYBETIME.”
dberrhandle, DBGETTIME, dbsetlogintime, dbsqlexec, dbsqlok, dbsqlsend