Help Center

CODBCStmt.PutDatamethod

Allows an application to send data for a parameter or column to the driver at statement execution time.

DatabasesmethodCODBCStmt.incdocumented

Syntax

FUNCTION PutData (BYVAL DataPtr AS SQLPOINTER, BYVAL StrLen_or_Ind AS SQLLEN) AS SQLRETURN

Parameters

NameDescription
DataPtrPointer to a buffer containing the actual data for the parameter or column. The data must be in the C data type specified in the ValueType argument of BindParameter (for parameter data) or the TargetType argument of BindCol (for column data).
StrLen_or_IndLength of DataPtr. Specifies the amount of data sent in a call to PutData. The amount of data can vary with each call for a given parameter or column. StrLen_or_Ind is ignored unless it meets one of the following conditions:
StrLen_or_Ind is SQL_NTS, SQL_NULL_DATA, or SQL_DEFAULT_PARAM.
The C data type specified in BindParameter or BindCol is SQL_C_CHAR or SQL_C_BINARY.
The C data type is SQL_C_DEFAULT, and the default C data type for the specified SQL data type is SQL_C_CHAR or SQL_C_BINARY.
For all other types of C data, if StrLen_or_Ind is not SQL_NULL_DATA or SQL_DEFAULT_PARAM, the driver assumes that the size of the DataPtr buffer is the size of the C data type specified with ValueType or TargetType and sends the entire data value.

Return value

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_STILL_EXECUTING, SQL_ERROR, or SQL_INVALID_HANDLE.

Description

Allows an application to send data for a parameter or column to the driver at statement execution time. This function can be used to send character or binary data values in parts to a column with a character, binary, or data source–specific data type (for example, parameters of the SQL_LONGVARBINARY or SQL_LONGVARCHAR types).

Reference

  • Include file CODBCStmt.inc
  • Defined in AfxNova/COdbcStmt.inc:288
  • Documented in Databases/ODBC Classes/CODBCStmt Class.md
  • Topic: CODBCStmt Class