dbsetnull

Description

Define substitution values to be used when binding null values.

Syntax

RETCODE dbsetnull(dbproc, bindtype, bindlen, bindval)
 
DBPROCESS    *dbproc;
int                        bindtype;
int                        bindlen;
BYTE                 *bindval;

Parameters

dbproc

A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.

bindtype

A symbolic value specifying the type of variable binding to which the substitute value will apply. (See the reference page for dbbind for more information about the allowable bindtype values.)

bindlen

The length in bytes of the substitute value you are supplying. DB-Library 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.

bindval

A generic BYTE pointer to the value you want to use as a null substitution value. dbsetnull makes a copy of the value, so you can free this pointer anytime after this call.

Returns

SUCCEED or FAIL.

dbsetnull returns FAIL if you give it an unknown bindtype. It will also fail if the specified DBPROCESS is dead.

Usage

See also

dbaltbind, dbbind, dbconvert, dbnullbind, Types