dbsqlok

Verifies the correctness of a command batch.

Syntax

RETCODE dbsqlok ( PDBPROCESS dbproc );

where

dbproc
Is the DBPROCESS structure that is the handle for a particular workstation/ SQL Server process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.

Returns

SUCCEED or FAIL. The most common reason for failing is a SQL syntax error.

Remarks

dbsqlok following dbsqlsend is the equivalent of dbsqlexec. This function must be called after dbsqlsend returns SUCCEED. If dbsqlok returns SUCCEED, then dbresults can be called to process the results.

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 timeout to regain control periodically.

See Also

dbcmd, dbfcmd, dbmoretext, dbnextrow, dbresults, dbsettime, dbsqlexec, dbsqlsend, dbwritetext