skip to main content
IP API Reference for C/C++ : IP API for C/C++ : OASQLIP_get_numcols
 

OASQLIP_get_numcols

This function returns the description for the specified column. This function is called m times where m is the number of columns returned by the OASQLIP_get_numcols function.
You must return the data in the OASQLIP_get_colval function in the same format as the definition of the column. For example, if you return the description of the first column as XO_TYPE_INTEGER, then return the data in OASQLIP_get_colval as XO_TYPE_INTEGER. It is also important to make sure the column descriptions returned by the OASQLIP_get_numcols function match those defined in your schema tables.
int OASQLIP_get_numcols(
SQLIP_HSTMT sqlip_hstmt,
OADS_INTEGER iCol,
OADS_INTEGER * piCardinality,
OADS_SMALLINT * piXODataType,
OADS_SMALLINT * pbNullable,
OAWCHAR ** ppColName,
OADS_ULEN * piLen,
OADS_SMALLINT * piScale)
 
Table 32: Parameters for OASQLIP_get_numcols 
Parameter
Type
Description
INPUT
 
 
sqlip_hstmt
SQLIP_HSTMT
Statement handle
iCol
OADS_INTEGER
Column number – first column starts at 0.
OUTPUT
 
 
piCardinality
OADS_INTEGER *
Used for array data types. Indicates the number of elements this array can contain.
piXODataType
OADS_SMALLINT *
Data type of the column. This information describes how the value of this column will be returned when OASQLIP_get_colval is called.
pbNullable
OADS_SMALLINT*
Whether the column can have null values.
1 – column can have null values
0 – the column cannot have null values
ppColName
OAWCHAR **
Return a pointer to the column name. The OpenAccess SDK layer copies to characters the contents of the supplied buffer.
piLen
OADS_ULEN *
Maximum length of the data in this column. Leave null for other types.
CHAR and VARCHAR – maximum length of the string
NUMERIC – precision + 2
piPrecision
OADS_ULEN *
Number of digits of mantissa precision.
NUMERIC - Number of digits
CHAR and VARCHAR – set to same as pollen
INTEGER=10, SMALLINT=5, DOUBLE=15, REAL=7,FLOAT=15
DATE=10, TIME=8, TIMESTAMP=19
piScale
OADS_SMALLINT *
Total number of significant digits to the right of the decimal point. Only required for NUMERIC types
RETURN
 
 
 
in
OADS_SUCCESS
OADS_ERROR

See also 

OASQLIP_get_colval
OASQLIP_get_numcols