An sqlvar_struct structure

When all of its components are fully defined, the sqlda structure points to the initial address of a sequence of sqlvar_struct structures that contain the necessary information for each variable in the set. Each sqlvar_struct structure holds a data value that can be sent to or received from the database server. Your program accesses these sqlvar_struct structures through the sqlvar field of sqlda. Field to access the variable-sized portion of an sqlda structure and Fields in the sqlvar_struct structure summarize the variable-sized structure of sqlda.
Table 1. Field to access the variable-sized portion of an sqlda structure
Field Data type Description
sqlvar struct sqlvar_struct * A pointer to the variable-sized portion of an sqlda structure. There is one sqlvar_struct for each column value returned from or sent to the database server. The sqlvar field points to the first of the sqlvar_struct structures.
The following table shows the fields in the sqlvar_struct structure.
Table 2. Fields in the sqlvar_struct structure
Field Data type Description
sqltype short An integer that identifies the data type of the column that the database server sends or receives. These values are defined in the sqltypes.h and sqlxtype.h header files. (See Determine the data type of a column.)
sqllen short The length, in bytes, of CHAR type data, or the encoded qualifier of a DATETIME or INTERVAL value. What the length means depends on the type of information and how the sqlda is used:
  • When you retrieve the sqlda structure with a DESCRIBE statement, the value in the sqllen field is automatically set to the length of the space that is occupied by the data on disk. The value comes from the system catalog.
  • When you fetch data into buffers or send data through the buffers, you must set the value in the sqllen field to the size of the memory buffer that is used for the column.
sqldata char * A pointer to the column data that the database server sends or receives. (See Allocate memory for column data.)
sqlind short * A pointer to an indicator variable for the column that can contain one of two values:
0
The sqldata field contains non-null data.
-1
The sqldata field contains null data.
sqlname char * A pointer to a character array that contains the column name or display label that the database server sends or receives.
sqlformat char * Reserved for future use.
sqlitype short An integer that specifies the data type of a user-defined indicator variable. These values are defined in the sqltypes.h and sqlxtype.h header files. (See Determine the data type of a column.)
sqlilen int4 The length, in bytes, of a user-defined indicator variable.
sqlidata char * A pointer to the data of the user-defined indicator variable.
sqlxid int4 The extended identifier for the user-defined (opaque or distinct) or complex (collection or row) data type. See the HCL OneDB™ Guide to SQL: Reference for a description of the extended_id column of the sysxtdtypes system catalog table.
sqltypename char * The name of the user-defined (opaque or distinct) or complex (collection or row) data type. See the HCL OneDB Guide to SQL: Reference for a description of the name column of the sysxtdtypes system catalog table.
sqltypelen short The length, in bytes, of the string in the sqltypename field.
sqlownername char * The name of the owner (for ANSI databases) of the user-defined (opaque or distinct) or complex (collection or row) data type. See the HCL OneDB Guide to SQL: Reference for a description of the owner column of the sysxtdtypes system catalog.
sqlownerlen short The length, in bytes, of the string in the sqlownername field.
sqlsourcetype short The data type constant (from sqltypes.h) of the source data type for a distinct-type column. See the HCL OneDB Guide to SQL: Reference for a description of the type column of the sysxtdtypes system catalog.
sqlsourceid int4 The extended identifier of the source data type for a distinct-type column. See the HCL OneDB Guide to SQL: Reference for a description of the source column of the sysxtdtypes system catalog.
sqlflags int4 This field is usually for internal use. However, if the sqlda structure has been initialized by a DESCRIBE statement you can determine if the column accepts nulls by using the ISCOLUMNULLABLE() macro on this field. If it returns 1 then the column accepts nulls.

The ISCOLUMNULLABLE() macro is defined in sqltypes.h.