The following routines cancel results:
dbcancel – cancels results from the current command batch. This routine cancels all the commands in the current batch.
dbcanquery – cancels any rows pending from the most recently executed query.
As an example of the difference between these routines, consider an application that is processing the results of the language batch:
select * from pubs.titles
select * from pubs.authors
If the application calls dbcanquery while processing the titles rows, then the titles rows are discarded and the application must continue to call dbresults and process the rows from the next statement. If the application calls dbcancel while processing the titles rows, then DB-Library discards the titles rows and the results of all remaining, unprocessed commands in the batch. The application does not need to continue calling dbresults after calling dbcancel.