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

  1. .Na "dbsetnull" 
  2. .Aa
  3. .Fu
  4. Define substitution values to be used when binding null values.
  5. .Ih "null values, defining substitution values for"
  6. .Ih "binding null values"
  7. .Ih "null values, binding"
  8. .Sy
  9. .Sf "RETCODE dbsetnull(dbproc, bindtype, bindlen, bindval)"
  10. .Sp "DBPROCESS" "*dbproc"
  11. .Sp "int" "bindtype"
  12. .Sp "int" "bindlen"
  13. .Sp "BYTE" "*bindval"
  14. .Co
  15. .Bl
  16. The 
  17. .I "dbbind()"
  18. and
  19. .I "dbaltbind()"
  20. routines bind result column values to program variables.
  21. After the application calls them,
  22. calls to \f2dbnextrow()\f1 and \f2dbgetrow()\f1
  23. automatically copy result values into the variables to which they are bound.
  24. If \*S returns a null value for one of the result columns, \*L automatically places
  25. a substitute value into the result variable.
  26. .Bl
  27. Each DBPROCESS has
  28. a list of substitute values for each of the binding types.
  29. The default substitution values are:
  30. .sp
  31. .ta 1.8i
  32. .nf
  33. .in +5n
  34. .ne 15
  35. \f3Binding Type    Null Substitution Value\f1
  36. .sp 0.5v
  37. TINYBIND    0
  38. SMALLBIND    0
  39. INTBIND        0
  40. CHARBIND    empty string (padded with blanks)
  41. STRINGBIND    empty string (padded with blanks, null-terminated)
  42. NTBSTRINGBIND    empty string (null-terminated)
  43. VARYCHARBIND    empty string
  44. BINARYBIND    empty array (padded with zeros)
  45. VARYBINBIND    empty array
  46. DATETIMEBIND    8 bytes of zeros
  47. MONEYBIND    $0.00
  48. FLT8BIND    0.0
  49. .in -5n
  50. .fi
  51. .Bl
  52. \f2dbsetnull()\f1 lets you provide your own null substitution values.
  53. When you call
  54. .I "dbsetnull()"
  55. to change a particular null substitution value, the new value will remain in force for the specified
  56. DBPROCESS until you change it with another call to
  57. .I "dbsetnull()."
  58. .Bl
  59. The \f2dbconvert()\f1 routine also uses the current null substitution values when
  60. it needs to set a destination variable to null.
  61. .Bz
  62. .Pa
  63. .Pi dbproc
  64. A pointer to the DBPROCESS structure that provides the connection
  65. for a particular front-end/\*S process.  It contains all the
  66. information that \*L uses to manage communications and data between the
  67. front end and \*S.
  68. .Pi bindtype
  69. The type of variable binding to which the substitute value will apply.
  70. (See the manual page for \f2dbbind()\f1 for more information
  71. about the different \f2bindtypes\f1.)
  72. .Pi bindlen
  73. The length in bytes of the substitute value you are supplying.  \*L ignores it
  74. in all cases except CHARBIND and BINARYBIND.
  75. All the other types are either fixed
  76. length or have a special terminator or embedded byte-count that provides the length
  77. of the data.
  78. .Pi bindval
  79. A generic BYTE pointer to the value you want to use as a null substitution value.
  80. \f2dbsetnull()\f1 makes a copy of the value, so you can free this
  81. pointer at any time after this call.
  82. .in -.375i
  83. .Re
  84. .br
  85. SUCCEED or FAIL.  
  86. \f2dbsetnull()\f1 returns FAIL if you give it an unknown \f2bindtype\f1.
  87. It will also fail if the specified DBPROCESS is dead.
  88. .Sa
  89. dbaltbind,
  90. dbbind,
  91. dbconvert,
  92. types
  93.