odbx_column_type(3)

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

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

\FCint odbx_column_type\F[]
\FC(odbx_result_t* result, unsigned long pos);\F[]

DESCRIPTION
\FCodbx_column_type\F[]() returns the data type of the requested column within the current result set returned by \FCodbx_result\F[](). The column type applies to all fields at the same position of the rows fetched via \FCodbx_row_fetch\F[](). 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_UNKNOWN\F[].

The \FCresult\F[] parameter required by this function must be a valid result set returned by \FCodbx_result\F[]() and must not has been feed to \FCodbx_result_finish\F[]() before.

Valid column indices for the requested column provided via \FCpos\F[] start with zero and end with the value returned by \FCodbx_column_count\F[]() 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_error\F[]().

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_BOOLEAN\F[]: True/false values

•   \FCODBX_TYPE_SMALLINT\F[]: Signed 16 bit integer

•   \FCODBX_TYPE_INTEGER\F[]: Signed 32 bit integer

•   \FCODBX_TYPE_BIGINT\F[]: Signed 64 bit integer

•   \FCODBX_TYPE_DECIMAL\F[]: Exact signed numeric values with user defined precision

Approximate numeric values:

•   \FCODBX_TYPE_REAL\F[]: Approximate numeric values (signed) with 32 bit precision

•   \FCODBX_TYPE_DOUBLE\F[]: Approximate numeric values (signed) with 64 bit precision

•   \FCODBX_TYPE_FLOAT\F[]: Approximate numeric values (signed) with user defined precision

String values:

•   \FCODBX_TYPE_CHAR\F[]: Fixed number of characters

•   \FCODBX_TYPE_NCHAR\F[]: Fixed number of characters using a national character set

•   \FCODBX_TYPE_VARCHAR\F[]: Variable number of characters

•   \FCODBX_TYPE_NVARCHAR\F[]: Variable number of characters using a national character set

Large objects:

•   \FCODBX_TYPE_CLOB\F[]: Large text object

•   \FCODBX_TYPE_NCLOB\F[]: Large text object using a national character set

•   \FCODBX_TYPE_XML\F[]: XML tree in text format

•   \FCODBX_TYPE_BLOB\F[]: Large binary object

Date and time values:

•   \FCODBX_TYPE_TIME\F[]: Time including hours, minutes and seconds

•   \FCODBX_TYPE_TIME_TZ\F[]: Time with timezone information

•   \FCODBX_TYPE_TIMESTAMP\F[]: Date and time

•   \FCODBX_TYPE_TIMESTAMP_TZ\F[]: Date and time with timezone information

•   \FCODBX_TYPE_DATE\F[]: Date including year, month and day

•   \FCODBX_TYPE_INTERVAL\F[]: Date interval

Arrays and sets:

•   \FCODBX_TYPE_ARRAY\F[]: Array of values

•   \FCODBX_TYPE_MULTISET\F[]: Associative arrays

External links:

•   \FCODBX_TYPE_DATALINK\F[]: URI locators like URL links

Vendor specific:

•   \FCODBX_TYPE_UNKNOWN\F[]: Vendor specific data type without representation in SQL2003

ERRORS

-\FCODBX_ERR_BACKEND\F[]
    The native database library returned an error

-\FCODBX_ERR_PARAM\F[]
    Either the \FCresult\F[] parameter is NULL respectively is invalid or the value of \FCpos\F[] is out of range

SEE ALSO
\FCodbx_column_count\F[](), \FCodbx_column_name\F[](), \FCodbx_field_value\F[](), \FCodbx_result\F[]()