odbx_column_type - Man Page

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

Synopsis

#include <opendbx/api.h>

int odbx_column_type (odbx_result_t* result, unsigned long pos);

Description

odbx_column_type() returns the data type of the requested column within the current result set returned by odbx_result(). The column type applies to all fields at the same position of the rows fetched via odbx_row_fetch(). 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 ODBX_TYPE_UNKNOWN.

The result parameter required by this function must be a valid result set returned by odbx_result() and must not has been feed to odbx_result_finish() before.

Valid column indices for the requested column provided via pos start with zero and end with the value returned by odbx_column_count() 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 odbx_error().

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:

Approximate numeric values:

String values:

Large objects:

Date and time values:

Arrays and sets:

External links:

Vendor specific:

Errors

-ODBX_ERR_BACKEND

The native database library returned an error

-ODBX_ERR_PARAM

Either the result parameter is NULL respectively is invalid or the value of pos is out of range

See Also

odbx_column_count(), odbx_column_name(), odbx_field_value(), odbx_result()

Referenced By

odbx_column_count(3), odbx_column_name(3), odbx_field_value(3), odbx_result(3), odbx_row_fetch(3).

20 July 2023 OpenDBX