dbanullbind
Associates an indicator variable with a compute-row column.
Syntax
RETCODE dbanullbind (
PDBPROCESS dbproc,
INT computeid,
INT column,
LPCDBINT indicator );
Arguments
- dbproc
- Is the DBPROCESS structure that is the handle for a particular workstation/ Microsoft® SQL Server™ process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.
- computeid
- Is the ID that identifies the COMPUTE clause. A SELECT statement can have multiple COMPUTE clauses, which can have varying numbers of aggregate operators and aggregate targets. The computeid is returned by dbnextrow or dbgetrow. A value of 1 is the computeid corresponding to the first compute clause in a SELECT statement.
- column
- Is the number of the column to be associated with the indicator variable.
- indicator
- Is a pointer to the indicator variable.
Note The indicator parameter is just the pointer to the indicator variable. The variable itself is set.
Returns
SUCCEED or FAIL. The dbanullbind function returns FAIL if computeid or column is invalid.
Remarks
The indicator variable reveals whether a particular compute-row column has been converted and copied to a program variable successfully or unsuccessfully, or whether it is NULL. Call dbanullbind only after dbnextrow or dbgetrow returns a computeid.
The indicator variable is set when compute rows are processed through dbnextrow. The possible values are:
- -1 if the column is NULL.
- The full length of the column’s data. This value is in bytes if the column was bound to a program variable through dbaltbind, the binding did not specify
any data conversions, and the bound data was truncated because the program variable was too small to hold the column’s data.
- 0 if the column was successfully bound and copied to a program variable.
Note Detection of character string truncation is implemented only for CHARBIND and VARYCHARBIND.
See Also
(c) 1988-98 Microsoft Corporation. All Rights Reserved.