Reference

odbx_column_type(3)

Returns the SQL data type of a column in the current result set

NAME

odbx_column_type - Returns the SQL data type of a column in the current result set

SYNOPSIS

FC#include <opendbx/api.h>F[0]

FCint odbx_column_typeF[0] FC(odbx_result_t* result, unsigned long pos);F[0]

DESCRIPTION

FCodbx_column_typeF[0]() returns the data type of the requested column within the current result set returned by FCodbx_resultF[0](). The column type applies to all fields at the same position of the rows fetched via FCodbx_row_fetchF[0](). The definitions are based on the SQL2003 standard and the data types of the database server have to comply to the specification of the standard. Data types provided by database implementations which are not covered by the SQL2003 standard are subsumed as FCODBX_TYPE_UNKNOWNF[0].

The FCresultF[0] parameter required by this function must be a valid result set returned by FCodbx_resultF[0]() and must not has been feed to FCodbx_result_finishF[0]() before.

Valid column indices for the requested column provided via FCposF[0] start with zero and end with the value returned by FCodbx_column_countF[0]() minus one.

RETURN VALUE

If a values less than zero is returned, an error occurred. Possible error codes are listed in the error section and the application can retrieve a textual message of the error by calling FCodbx_errorF[0]().

A positive return value including zero indicates one of the SQL2003 compliant data types listed below. Before release 1.1.5 of the OpenDBX library, types were defined as ODBX_* instead of ODBX_TYPE_*. The old definitions are kept for backward compatibility but shouldn't be used any more. They will be removed at some point in the future.

Exact numeric values:

•

FCODBX_TYPE_BOOLEANF[0]: True/false values

•

FCODBX_TYPE_SMALLINTF[0]: Signed 16 bit integer

•

FCODBX_TYPE_INTEGERF[0]: Signed 32 bit integer

•

FCODBX_TYPE_BIGINTF[0]: Signed 64 bit integer

•

FCODBX_TYPE_DECIMALF[0]: Exact signed numeric values with user defined precision

Approximate numeric values:

•

FCODBX_TYPE_REALF[0]: Approximate numeric values (signed) with 32 bit precision

•

FCODBX_TYPE_DOUBLEF[0]: Approximate numeric values (signed) with 64 bit precision

•

FCODBX_TYPE_FLOATF[0]: Approximate numeric values (signed) with user defined precision

String values:

•

FCODBX_TYPE_CHARF[0]: Fixed number of characters

•

FCODBX_TYPE_NCHARF[0]: Fixed number of characters using a national character set

•

FCODBX_TYPE_VARCHARF[0]: Variable number of characters

•

FCODBX_TYPE_NVARCHARF[0]: Variable number of characters using a national character set

Large objects:

•

FCODBX_TYPE_CLOBF[0]: Large text object

•

FCODBX_TYPE_NCLOBF[0]: Large text object using a national character set

•

FCODBX_TYPE_XMLF[0]: XML tree in text format

•

FCODBX_TYPE_BLOBF[0]: Large binary object

Date and time values:

•

FCODBX_TYPE_TIMEF[0]: Time including hours, minutes and seconds

•

FCODBX_TYPE_TIME_TZF[0]: Time with timezone information

•

FCODBX_TYPE_TIMESTAMPF[0]: Date and time

•

FCODBX_TYPE_TIMESTAMP_TZF[0]: Date and time with timezone information

•

FCODBX_TYPE_DATEF[0]: Date including year, month and day

•

FCODBX_TYPE_INTERVALF[0]: Date interval

Arrays and sets:

•

FCODBX_TYPE_ARRAYF[0]: Array of values

•

FCODBX_TYPE_MULTISETF[0]: Associative arrays

External links:

•

FCODBX_TYPE_DATALINKF[0]: URI locators like URL links

Vendor specific:

•

FCODBX_TYPE_UNKNOWNF[0]: Vendor specific data type without representation in SQL2003

ERRORS

-FCODBX_ERR_BACKENDF[0]

The native database library returned an error

-FCODBX_ERR_PARAMF[0]

Either the FCresultF[0] parameter is NULL respectively is invalid or the value of FCposF[0] is out of range

SEE ALSO

FCodbx_column_countF[0](), FCodbx_column_nameF[0](), FCodbx_field_valueF[0](), FCodbx_resultF[0]()

History