skip to main content
OpenAccess SDK SQL Engine Core Functions API : Function Reference : dam_addValToRow
 

dam_addValToRow

This function is used to build up a row by adding values for columns one at a time. This function requires the data to be passed in using the same data type as the column definition or in any format from which data conversion is supported.
Character data can be added by specifying the length or by marking the data as null terminated. NULL data is added by specifying the XO_NULL_DATA value flag for the column value length.
This function copies data from the user supplied buffer to its internal buffers and therefore the IP can free the memory associated with the input buffer (pColVal).
int dam_addValToRow(
DAM_HSTMT hstmt,
DAM_HROW hRow,
DAM_HCOL hCol,
int iXoType,
void * *pColVal,
long lColValLen)
Table 65. Parameters for dam_addValToRow
Parameter
Type
Description
IN
hstmt
DAM_HSTMT
The statement handle
hRow
DAM_HROW
The row handle
hCol
DAM_HCOL
The column handle
iXoType
int
Type of the data. The data can be supplied in a format that corresponds to the column's definition in the schema or in any other format and the OpenAccess SDK SQL engine will perform the required conversion.
pColVal
void *
A pointer to the data. The C type of the data should correspond to the iXoType value. See Table 33.
IColValLen
long
The length of the data:
XO_NULL_DATA - indicates a null value.
For VARCHAR, CHAR and NUMERIC: either the length of the string or XO_NTS if the string is null terminated.
For Unicode strings the length is in characters.
For all other data types, the length of the data
Note: The length value is required so that OpenAccess SDK can validate that the correct size of data is passed in for the iXoType.
RETURN
int
DAM_SUCCESS - added the value to the row.
DAM_FAILURE - error adding the value.
The LONGVARBINARY, LONGVARCHAR, and WLONGVARCHAR type of data can be provided to the OpenAccess SDK SQL engine in segments by calling dam_addValToRow multiple times. In each call, include the data and its length. Also, the data must be provided as binary data and not as character data.

See also

*dam_addValToRow