Download Informix CLI Programmer`s Manual, Version 2.5

Transcript
SQLBindParameter
pcbValue Argument
The pcbValue argument points to a buffer that, when SQLExecute or SQLExecDirect is called, contains one of the following values:
■
The length of the parameter value stored in rgbValue
This is ignored except for character or binary C data.
■
SQL_NTS
The parameter value is a null-terminated string.
■
SQL_NULL_DATA
The parameter value is NULL.
■
SQL_DEFAULT_PARAM
A procedure is to use the default value of a parameter, rather than a
value retrieved from the application. This value is valid only in a
procedure call and then only if the fParamType argument is
SQL_PARAM_INPUT or SQL_PARAM_INPUT_OUTPUT. When pcbValue
is SQL_DEFAULT_PARAM, the corresponding parameter can only be
a parameter for an ODBC canonical procedure invocation. When
pcbValue is SQL_DEFAULT_PARAM, the fCType, fSqlType, cbColDef,
ibScale, cbValueMax and rgbValue arguments are ignored for input
parameters and are used only to define the output parameter value
for input/output parameters. This value was introduced in ODBC
2.0.
■
The result of the SQL_LEN_DATA_AT_EXEC(length) macro
The data for the parameter is sent with SQLPutData. If the fSqlType
argument is SQL_LONGVARBINARY, SQL_LONGVARCHAR, or a long,
data-source-specific data type and the driver returns “Y” for the
SQL_NEED_LONG_DATA_LEN information type in SQLGetInfo,
length is the number of bytes of data to be sent for the parameter;
otherwise, length must be a nonnegative value and is ignored. For
more information, see “Passing Parameter Values” on page 13-34.
For example, to send 10,000 bytes of data with SQLPutData for an
SQL_LONGVARCHAR parameter, an application sets pcbValue to
SQL_LEN_DATA_AT_EXEC(10000). This macro was introduced in
ODBC 2.0.
INFORMIX-CLI Function Reference 13-33