Returns the sql data type of a column in the current result set
\*(T<#include <opendbx/api.h>\*(T>
\*(T<int odbx_column_type\*(T> \kx \*(T<(odbx_result_t* result, unsigned long pos);\*(T>
\*(T<odbx_column_type\*(T>() returns the data type of the requested column within the current result set returned by \*(T<odbx_result\*(T>(). The column type applies to all fields at the same position of the rows fetched via \*(T<odbx_row_fetch\*(T>(). 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 \*(T<ODBX_TYPE_UNKNOWN\*(T>.
The \*(T<result\*(T> parameter required by this function must be a valid result set returned by \*(T<odbx_result\*(T>() and must not has been feed to \*(T<odbx_result_finish\*(T>() before.
Valid column indices for the requested column provided via \*(T<pos\*(T> start with zero and end with the value returned by \*(T<odbx_column_count\*(T>() minus one.
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 \*(T<odbx_error\*(T>().
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:
•
\*(T<ODBX_TYPE_BOOLEAN\*(T>: True/false values
•
\*(T<ODBX_TYPE_SMALLINT\*(T>: Signed 16 bit integer
•
\*(T<ODBX_TYPE_INTEGER\*(T>: Signed 32 bit integer
•
\*(T<ODBX_TYPE_BIGINT\*(T>: Signed 64 bit integer
•
\*(T<ODBX_TYPE_DECIMAL\*(T>: Exact signed numeric values with user defined precision
Approximate numeric values:
•
\*(T<ODBX_TYPE_REAL\*(T>: Approximate numeric values (signed) with 32 bit precision
•
\*(T<ODBX_TYPE_DOUBLE\*(T>: Approximate numeric values (signed) with 64 bit precision
•
\*(T<ODBX_TYPE_FLOAT\*(T>: Approximate numeric values (signed) with user defined precision
String values:
•
\*(T<ODBX_TYPE_CHAR\*(T>: Fixed number of characters
•
\*(T<ODBX_TYPE_NCHAR\*(T>: Fixed number of characters using a national character set
•
\*(T<ODBX_TYPE_VARCHAR\*(T>: Variable number of characters
•
\*(T<ODBX_TYPE_NVARCHAR\*(T>: Variable number of characters using a national character set
Large objects:
•
\*(T<ODBX_TYPE_CLOB\*(T>: Large text object
•
\*(T<ODBX_TYPE_NCLOB\*(T>: Large text object using a national character set
•
\*(T<ODBX_TYPE_XML\*(T>: XML tree in text format
•
\*(T<ODBX_TYPE_BLOB\*(T>: Large binary object
Date and time values:
•
\*(T<ODBX_TYPE_TIME\*(T>: Time including hours, minutes and seconds
•
\*(T<ODBX_TYPE_TIME_TZ\*(T>: Time with timezone information
•
\*(T<ODBX_TYPE_TIMESTAMP\*(T>: Date and time
•
\*(T<ODBX_TYPE_TIMESTAMP_TZ\*(T>: Date and time with timezone information
•
\*(T<ODBX_TYPE_DATE\*(T>: Date including year, month and day
•
\*(T<ODBX_TYPE_INTERVAL\*(T>: Date interval
Arrays and sets:
•
\*(T<ODBX_TYPE_ARRAY\*(T>: Array of values
•
\*(T<ODBX_TYPE_MULTISET\*(T>: Associative arrays
External links:
•
\*(T<ODBX_TYPE_DATALINK\*(T>: URI locators like URL links
Vendor specific:
•
\*(T<ODBX_TYPE_UNKNOWN\*(T>: Vendor specific data type without representation in SQL2003
-\*(T<ODBX_ERR_BACKEND\*(T>
The native database library returned an error
-\*(T<ODBX_ERR_PARAM\*(T>
Either the \*(T<result\*(T> parameter is NULL respectively is invalid or the value of \*(T<pos\*(T> is out of range
\*(T<odbx_column_count\*(T>(), \*(T<odbx_column_name\*(T>(), \*(T<odbx_field_value\*(T>(), \*(T<odbx_result\*(T>()