Cancel the current command batch.
RETCODE dbcancel(dbproc) DBPROCESS *dbproc;
A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.
SUCCEED or FAIL.
The most common reasons for failure are a dead DBPROCESS or a network error. dbcancel will also return FAIL if the server is dead.
This routine cancels execution of the current command batch on the server and flushes any pending results. The application can call it after calling dbsqlexec, dbsqlsend, dbsqlok, dbresults, or dbnextrow.The dbcancel routine sends an attention packet to the server which causes the server to cease execution of the command batch. Any pending results are read and discarded.
dbcancel cancels all the commands in the current command batch. To cancel only the results from the current command, call dbcanquery instead.
Some applications may need the ability to cancel a long-running query while DB-Library is reading from the network. In this case, the application should use one of these methods:
Set a time limit for server reads with dbsettime, and add a special case to your error handler function to respond to SYBETIME errors. See the reference pages for dberrhandle and dbsettime for details.
Use dbsetinterrupt to install custom interrupt handling. See the reference page for dbsetinterrupt for details.
If you have set your own interrupt handler using dbsetinterrupt, you cannot call dbcancel in your interrupt handler. This would cause output from the server to DB-Library to become out of sync. See the reference page for dbsetinterrupt for an explanation of how to cancel from an interrupt handler.
dbcanquery, dbnextrow, dbresults, dbsetinterrupt, dbsqlexec, dbsqlok, dbsqlsend