Verifies the correctness of a command batch.
RETCODE dbsqlok ( PDBPROCESS dbproc );
SUCCEED or FAIL. The most common reason for failing is a Transact-SQL syntax error.
dbsqlok following dbsqlsend is the equivalent of dbsqlexec. This function must be called after dbsqlsend returns SUCCEED. When dbsqlok returns, then dbresults can be called to process the results. In a batch, if the last statement fails, then dbsqlok returns FAIL but there may still be some result set to process. So even if dbsqlok returns FAIL, dbresults should be called to process any outstanding result set (until NO_MORE_RESULTS is returned).
The dbsqlok function is also useful in text-update operations. When chunks of text are sent to SQL Server using dbmoretext, dbsqlok must be called before the first call to dbmoretext and after the last call to dbmoretext. For an example of its use in this context, see dbwritetext.
Note This function is one of the four that do not return control to the application until the server sends the required response. The application can be blocked for a considerable time if the server is waiting for a lock or processing a large sort. If this is unacceptable, always call dbdataready before dbsqlok and set the DB-Library time-out to regain control periodically.
dbcmd | dbsettime |
dbfcmd | dbsqlexec |
dbmoretext | dbsqlsend |
dbnextrow | dbwritetext |
dbresults |