Sets a SQL Server or DB-Library option.
RETCODE dbsetopt (
PDBPROCESS dbproc,
INT option,
LPCSTR param );
where
dbsetopt(dbproc, DBOFFSET, "compute")
The DBBUFFER option takes as its parameter the number of rows to be buffered. A parameter of -1 selects the default (currently 100 rows). The syntax is as follows:
dbsetopt(dbproc, DBBUFFER, "500")
Note The param variable must always be a character string enclosed in quotation marks, even in the case of a numeric value, as in the preceding DBBUFFER example.
If the option takes no parameters, param is ignored and may be NULL.
SUCCEED or FAIL.
This function fails if param is invalid for one of the DB-Library options. However, an invalid param for a SQL Server option does not cause dbsetopt to fail, because such a parameter does not get validated until the command buffer is sent to SQL Server.
Although SQL Server options can be set and cleared directly through SQL, the application should use dbsetopt and dbclropt to set and clear options. This provides a uniform interface for setting both SQL Server and DB-Library options. It also allows the application to use the dbisopt function to check the status of an option.
This function does not immediately set the options specified. They are not set until the command buffer is sent to SQL Server (by invoking the dbsqlexec function). An additional result for each option set is returned through the dbresults function. (For information about results returned, see "dbresults.")
For a list of each option and its default status, see DB-Library Options.
dbclropt, dbisopt, dbresults, dbsqlexec; Bulk-Copy Functions, and DB-Library Options