skip to main content
OpenAccess SDK SQL Engine core methods for Java : Exchanging data : dam_addColAliasxxxValToRow
 

dam_addColAliasxxxValToRow

These methods are used to build up a row by adding values for result columns based on Alias names. The result column handle refers to column handles that are returned by dam_describeColResAlias.
These methods require all data to be passed in using the same format as the column definition in the schema database or in any format for which a conversion is supported. Please refer to the following data conversion table:
http://www.datadirect.com/download/docs/openaccess/alloa/dataconversiontable.htm
Character data can be added by supplying 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. These methods copy data from the user supplied buffer to its internal buffers and therefore the IP can free the memory associated with the input buffer (pColVal).
For a Java IP, there are data type specific methods.
int dam_addColAliasBigIntValToRow(
    long hstmt,
    long hRow,
    long hColAlias,
    long colVal,
    int lColValLen)

int dam_addColAliasBinaryValToRow(
    int    dam_hstmt,
    long   hRow,
    long   hColAlias,
    byte[] pColVal,
    int    lColValLen)

int dam_addColAliasBitValToRow(
    long    hstmt,
    long    hRow,
    long    hColAlias,
    boolean colVal,
    int     lColValLen)

int dam_addColAliasCharValToRow(
    long   hstmt,
    long   hRow,
    long   hColAlias,
    String colVal,
    int    lColValLen)

int dam_addColAliasWCharValToRow(
    long   hstmt,
    long   hRow,
    long   hColAlias,
    String colVal,
    int    lColValLen)

    int dam_addColAliasDoubleValToRow(
    long   hstmt,
    long   hRow,
    long   hColAlias,
    double colVal,
    int    lColValLen)

int dam_addColAliasFloatValToRow(
    long  hstmt,
    long  hRow,
    long  hColAlias,
    float colVal,
    int   lColValLen)

int dam_addColAliasIntValToRow(
    long hstmt,
    long hRow,
    long hColAlias,
    int  colVal,
    int  lColValLen)

int dam_addColAliasShortValToRow(
    long  hstmt,
    long  hRow,
    long  hColAlias,
    short colVal,
    int   lColValLen)

int dam_addColAliasTimeStampValToRow(
    long  hstmt,
    long  hRow,
    long  hColAlias,
    xo_tm colVal,
    int   lColValLen)

int dam_addColAliasTinyintValToRow(
    long hstmt,
    long hRow,
    long hColAlias,
    byte colVal,
    int  lColValLen)
Table 119. Parameters for dam_addColAliasxxxValToRow
Parameter
Type
Description
INPUT
hstmt
long
The statement handle.
hRow
long
The row handle.
hColAlias
long
The column handle returned from dam_describeColResAlias.
ColVal
Depends on the method used
The Java type of the data should correspond to the iXoType value. See Table 34. 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.
lColValLen
int
The length of the data:
XO_NULL_DATA - indicates a null value.
For VARCHAR, CHAR, WVARCHAR, WCHAR, and NUMERIC, either the number of characters or XO_NTS to add the entire string.
For all other data types, the length of the data.
Note: The length value is required to allow OpenAcccess SDK to 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 type can be provided to the OpenAccess SDK SQL engine in segments by calling this method 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_describeColResAlias