home *** CD-ROM | disk | FTP | other *** search
- .Na "dbsetnull"
- .Aa
- .Fu
- Define substitution values to be used when binding null values.
- .Ih "null values, defining substitution values for"
- .Ih "binding null values"
- .Ih "null values, binding"
- .Sy
- .Sf "RETCODE dbsetnull(dbproc, bindtype, bindlen, bindval)"
- .Sp "DBPROCESS" "*dbproc"
- .Sp "int" "bindtype"
- .Sp "int" "bindlen"
- .Sp "BYTE" "*bindval"
- .Co
- .Bl
- The
- .I "dbbind()"
- and
- .I "dbaltbind()"
- routines bind result column values to program variables.
- After the application calls them,
- calls to \f2dbnextrow()\f1 and \f2dbgetrow()\f1
- automatically copy result values into the variables to which they are bound.
- If \*S returns a null value for one of the result columns, \*L automatically places
- a substitute value into the result variable.
- .Bl
- Each DBPROCESS has
- a list of substitute values for each of the binding types.
- The default substitution values are:
- .sp
- .ta 1.8i
- .nf
- .in +5n
- .ne 15
- \f3Binding Type Null Substitution Value\f1
- .sp 0.5v
- TINYBIND 0
- SMALLBIND 0
- INTBIND 0
- CHARBIND empty string (padded with blanks)
- STRINGBIND empty string (padded with blanks, null-terminated)
- NTBSTRINGBIND empty string (null-terminated)
- VARYCHARBIND empty string
- BINARYBIND empty array (padded with zeros)
- VARYBINBIND empty array
- DATETIMEBIND 8 bytes of zeros
- MONEYBIND $0.00
- FLT8BIND 0.0
- .in -5n
- .fi
- .Bl
- \f2dbsetnull()\f1 lets you provide your own null substitution values.
- When you call
- .I "dbsetnull()"
- to change a particular null substitution value, the new value will remain in force for the specified
- DBPROCESS until you change it with another call to
- .I "dbsetnull()."
- .Bl
- The \f2dbconvert()\f1 routine also uses the current null substitution values when
- it needs to set a destination variable to null.
- .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.
- .Pi bindtype
- The type of variable binding to which the substitute value will apply.
- (See the manual page for \f2dbbind()\f1 for more information
- about the different \f2bindtypes\f1.)
- .Pi bindlen
- The length in bytes of the substitute value you are supplying. \*L ignores it
- in all cases except CHARBIND and BINARYBIND.
- All the other types are either fixed
- length or have a special terminator or embedded byte-count that provides the length
- of the data.
- .Pi bindval
- A generic BYTE pointer to the value you want to use as a null substitution value.
- \f2dbsetnull()\f1 makes a copy of the value, so you can free this
- pointer at any time after this call.
- .in -.375i
- .Re
- .br
- SUCCEED or FAIL.
- \f2dbsetnull()\f1 returns FAIL if you give it an unknown \f2bindtype\f1.
- It will also fail if the specified DBPROCESS is dead.
- .Sa
- dbaltbind,
- dbbind,
- dbconvert,
- types
-