home *** CD-ROM | disk | FTP | other *** search
- .Na "dbsetopt"
- .Aa
- .Fu
- Set a \*S or \*L option.
- .Ih "option, setting an"
- .Sy
- .Sf "RETCODE dbsetopt(dbproc, option, param)"
- .Sp "DBPROCESS" "*dbproc"
- .Sp "int" "option"
- .Sp "char" "*param"
- .Co
- .Bl
- This routine sets \*S and \*L options.
- Although \*S options may be set and cleared directly through
- SQL, the application should instead use
- .I "dbsetopt()"
- and
- .I "dbclropt()"
- to set and clear options. This provides a uniform interface for
- setting both \*S and \*L options.
- It also allows the application to use the
- .I "dbisopt()"
- function to check the status of an option.
- .Bl
- \f2dbsetopt()\f1 does not immediately set the option.
- The option is set the next time a command buffer is sent
- to the \*S (by invoking \f2dbsqlexec()\f1 or \f2dbsqlsend()\f1).
- .Bl
- For a list of each option and its default
- status, see the manual page for
- .I options.
- .Bz
- .Pa
- .Pi dbproc
- A pointer to the DBPROCESS structure that provides the connection
- for a particular front-end/\*S process. It contains all the
- information that \*L uses to manage communications and data between the
- front end and \*S.
- If
- .I dbproc
- is NULL, the option will be set for all active DBPROCESS structures.
- .Pi option
- The option that is to be turned on.
- See the \f2options\f1 manual page for the list of options.
- .Pi param
- Certain options take parameters.
- For example, the DBOFFSET option
- takes as its parameter the construct
- for which offsets are to be returned:
- .SD
- .in +5n
- dbsetopt(dbproc, DBOFFSET, "compute")
- .in -5n
- .ED
- The DBBUFFER option takes as its parameter the number of rows to be buffered:
- .SD
- .in +5n
- dbsetopt(dbproc, DBBUFFER, "500")
- .in -5n
- .ED
- \f2param\f1 must always be a
- character string enclosed in quotes,
- even in the case of a numeric value, as in
- the DBBUFFER example.
- .sp 0.5v
- If an invalid parameter is specified for one of the \*S options,
- this will be discovered the next time a command buffer is sent to the \*S.
- The \f2dbsqlexec()\f1 or \f2dbsqlsend()\f1 call will fail, and \*L will invoke the user-installed
- message handler.
- If an invalid parameter is specified for one of the \*L options (DBBUFFER or DBTEXTLIMIT),
- the \f2dbsetopt()\f1 call itself will fail.
- .sp 0.5v
- If the option takes no parameters,
- .I param
- must be NULL.
- .in -.375i
- .Re
- .br
- SUCCEED or FAIL.
- .sp
- As mentioned above, \f2dbsetopt()\f1 will fail
- if \f2param\f1 is invalid for one of the \*L options.
- However, an invalid \f2param\f1 for a \*S option
- will not cause \f2dbsetopt()\f1 to fail, because such a
- parameter does not get validated until the command buffer
- is sent to the \*S.
- .Sa
- dbclropt,
- dbisopt,
- options
-