home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbsetopt.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  2.5 KB  |  91 lines

  1. .Na "dbsetopt" 
  2. .Aa
  3. .Fu
  4. Set a \*S or \*L option.
  5. .Ih "option, setting an"
  6. .Sy
  7. .Sf "RETCODE dbsetopt(dbproc, option, param)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .Sp "int" "option"
  10. .Sp "char" "*param"
  11. .Co
  12. .Bl
  13. This routine sets \*S and \*L options.
  14. Although \*S options may be set and cleared directly through
  15. SQL, the application should instead use
  16. .I "dbsetopt()"
  17. and
  18. .I "dbclropt()"
  19. to set and clear options.  This provides a uniform interface for
  20. setting both \*S and \*L options.
  21. It also allows the application to use the
  22. .I "dbisopt()"
  23. function to check the status of an option.
  24. .Bl
  25. \f2dbsetopt()\f1 does not immediately set the option.
  26. The option is set the next time a command buffer is sent
  27. to the \*S (by invoking \f2dbsqlexec()\f1 or \f2dbsqlsend()\f1).
  28. .Bl
  29. For a list of each option and its default
  30. status, see the manual page for
  31. .I options.
  32. .Bz
  33. .Pa
  34. .Pi dbproc
  35. A pointer to the DBPROCESS structure that provides the connection
  36. for a particular front-end/\*S process.  It contains all the
  37. information that \*L uses to manage communications and data between the
  38. front end and \*S.
  39. If
  40. .I dbproc
  41. is NULL, the option will be set for all active DBPROCESS structures.
  42. .Pi option
  43. The option that is to be turned on.
  44. See the \f2options\f1 manual page for the list of options.
  45. .Pi param
  46. Certain options take parameters.
  47. For example, the DBOFFSET option
  48. takes as its parameter the construct 
  49. for which offsets are to be returned:
  50. .SD
  51. .in +5n
  52. dbsetopt(dbproc, DBOFFSET, "compute")
  53. .in -5n
  54. .ED
  55. The DBBUFFER option takes as its parameter the number of rows to be buffered:
  56. .SD
  57. .in +5n
  58. dbsetopt(dbproc, DBBUFFER, "500")
  59. .in -5n
  60. .ED
  61. \f2param\f1 must always be a
  62. character string enclosed in quotes,
  63. even in the case of a numeric value, as in
  64. the DBBUFFER example.
  65. .sp 0.5v
  66. If an invalid parameter is specified for one of the \*S options, 
  67. this will be discovered the next time a command buffer is sent to the \*S.
  68. The \f2dbsqlexec()\f1 or \f2dbsqlsend()\f1 call will fail, and \*L will invoke the user-installed
  69. message handler.
  70. If an invalid parameter is specified for one of the \*L options (DBBUFFER or DBTEXTLIMIT),
  71. the \f2dbsetopt()\f1 call itself will fail.
  72. .sp 0.5v
  73. If the option takes no parameters, 
  74. .I param
  75. must be NULL.
  76. .in -.375i
  77. .Re
  78. .br
  79. SUCCEED or FAIL.
  80. .sp
  81. As mentioned above, \f2dbsetopt()\f1 will fail
  82. if \f2param\f1 is invalid for one of the \*L options.
  83. However, an invalid \f2param\f1 for a \*S option
  84. will not cause \f2dbsetopt()\f1 to fail, because such a 
  85. parameter does not get validated until the command buffer
  86. is sent to the \*S.
  87. .Sa
  88. dbclropt,
  89. dbisopt,
  90. options
  91.