odbx_column_type(3)
π odbx_column_type(3) β the OpenDBX manual, bestie edition π
okay so real talk: this is the odbx_column_type(3) page from the OpenDBX manual, and it's literally just one function that tells you what type your column is. tiny function, big slay. let's get into it β¨
πΈ NAME πΈ
odbx_column_type β returns the SQL data type of a column in the current result set. that's it, that's the whole job, and she does it flawlessly π
β¨ SYNOPSIS β¨
#include <opendbx/api.h>
int odbx_column_type (odbx_result_t* result, unsigned long pos);
two args, one int back. immaculate signature, no notes π«Ά
π¦ DESCRIPTION π¦
so odbx_column_type() returns the data type of the column you asked for, inside the current result set that came from odbx_result(). and like β the column type applies to all the fields sitting at that same position across every row you fetch with odbx_row_fetch(). same position, every row, same type. consistent queen behavior π
the type definitions are based on the SQL2003 standard, and the data types of your database server have to comply to that standard's specification. (yes, "have to". it's giving strict.) and if your database implementation ships some special data type that the SQL2003 standard just... doesn't cover? it gets subsumed as ODBX_TYPE_UNKNOWN. no cap, that's the bucket πͺ£
the result parameter is required by this function and it must be a valid result set returned by odbx_result(), and it must not has been feed to odbx_result_finish() before. (that's the original's grammar and honestly it ate, so it stays π) basically: don't hand her an already-finished result set. she will not be entertaining that.
valid column indices for the column you request via pos start at zero and end at the value returned by odbx_column_count() minus one. classic zero-indexed situation, you know the vibe π₯
π RETURN VALUE π
if a value less than zero comes back, an error happened, periodt. possible error codes are listed down in the error section, and your application can retrieve a textual message of the error by calling odbx_error(). very demure, very helpful π
a positive return value including zero indicates one of the SQL2003 compliant data types listed below β¨
π¨ lore drop: before release 1.1.5 of the OpenDBX library, types were defined asODBX_*instead ofODBX_TYPE_*. the old definitions are kept for backward compatibility but shouldn't be used any more, and they will be removed at some point in the future. so like... migrate bestie. don't get attached π
π’ Exact numeric values
ODBX_TYPE_BOOLEAN: true/false valuesODBX_TYPE_SMALLINT: signed 16 bit integerODBX_TYPE_INTEGER: signed 32 bit integerODBX_TYPE_BIGINT: signed 64 bit integerODBX_TYPE_DECIMAL: exact signed numeric values with user defined precision
π Approximate numeric values
ODBX_TYPE_REAL: approximate numeric values (signed) with 32 bit precisionODBX_TYPE_DOUBLE: approximate numeric values (signed) with 64 bit precisionODBX_TYPE_FLOAT: approximate numeric values (signed) with user defined precision
π String values
ODBX_TYPE_CHAR: fixed number of charactersODBX_TYPE_NCHAR: fixed number of characters using a national character setODBX_TYPE_VARCHAR: variable number of charactersODBX_TYPE_NVARCHAR: variable number of characters using a national character set
π Large objects
ODBX_TYPE_CLOB: large text objectODBX_TYPE_NCLOB: large text object using a national character setODBX_TYPE_XML: XML tree in text formatODBX_TYPE_BLOB: large binary object
π°οΈ Date and time values
ODBX_TYPE_TIME: time including hours, minutes and secondsODBX_TYPE_TIME_TZ: time with timezone informationODBX_TYPE_TIMESTAMP: date and timeODBX_TYPE_TIMESTAMP_TZ: date and time with timezone informationODBX_TYPE_DATE: date including year, month and dayODBX_TYPE_INTERVAL: date interval
π§ Arrays and sets
ODBX_TYPE_ARRAY: array of valuesODBX_TYPE_MULTISET: associative arrays
π External links
ODBX_TYPE_DATALINK: URI locators like URL links
π Vendor specific
ODBX_TYPE_UNKNOWN: vendor specific data type without representation in SQL2003
π ERRORS π
-ODBX_ERR_BACKENDβ the native database library returned an error. not her fault, blame the backend π-ODBX_ERR_PARAMβ either theresultparameter isNULLrespectively is invalid, or the value ofposis out of range. check your args bestie, she's not a mind reader π
π SEE ALSO π
odbx_column_count(), odbx_column_name(), odbx_field_value(), odbx_result() β the whole friend group, go say hi π«Ά
and that's the page!! this one's from OpenDBX, dated 6 February 2026, and it's odbx_column_type(3) β type-check your columns, stay iconic, and remember: zero-indexed, always πβ¨
π¦ where this page comes from
- ubuntu resolute: libopendbx1-dev 1.4.6-18build2
- ubuntu stonking: libopendbx1-dev 1.4.6-18build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms