Binds a column of a client cursor, transparent server cursor, or explicit server cursor to an array of program variables. This array of program variables is filled with result data after every fetch or refresh.
RETCODE dbcursorbind (
PDBCURSOR hc,
INT col,
INT vartype,
DBINT varlen,
LPDBINT poutlen,
LPBYTE pvaraddr );
In addition to the dbbind bind types, vartype can be set to NOBIND, indicating that no binding is established for a column. After a fetch:
This parameter is ignored for fixed-length data types (all other vartype values except those given earlier) and when vartype is NOBIND.
If poutlen is set to NULL, the lengths are not returned.
Before calling dbcursor to update or insert a row with values from the pvaraddr array of bound program variables, set the corresponding poutlen element (for that row in the fetch buffer) to one of the following values:
Client cursor, transparent server cursor:
The number of elements in this array must equal the nrows parameter of dbcursoropen.
Explicit server cursor:
The maximum number of elements in this array is the nrows parameter of dbcursoropen. Before a fetch is made, the number of elements in this array must be equal to or greater than the nfetchnrows parameter that will be passed to dbcursorfetchex.
Setting pvaraddr to NULL breaks any existing binding established by a previous call to dbcursorbind for the column.
Client cursor, transparent server cursor:
The number of elements in this array must equal the nrows parameter of dbcursoropen.
Explicit server cursor:
The maximum number of elements in this array is the nrows parameter of dbcursoropen. Before a fetch is made, the number of elements in this array must be equal to or greater than the nfetchnrows parameter that will be passed to dbcursorfetchex.
SUCCEED or FAIL.
If dbcursorbind is called more than once for any column, only the last call will be effective.
Bulk-Copy Functions | dbcursorfetch |
dbcursor | dbcursorinfo |
dbcursorclose | dbcursoropen |
dbcursorcolinfo |