1odbx_column_type(3)                 OpenDBX                odbx_column_type(3)
2
3
4

NAME

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

SYNOPSIS

10       #include <opendbx/api.h>
11
12
13       int odbx_column_type (odbx_result_t* result, unsigned long pos);
14

DESCRIPTION

16       odbx_column_type() returns the data type of the requested column within
17       the  current  result set returned by odbx_result(). The column type ap‐
18       plies to all fields at the  same  position  of  the  rows  fetched  via
19       odbx_row_fetch(). The definitions are based on the SQL2003 standard and
20       the data types of the database server have to comply to the  specifica‐
21       tion  of  the standard. Data types provided by database implementations
22       which  are  not  covered  by  the  SQL2003  standard  are  subsumed  as
23       ODBX_TYPE_UNKNOWN.
24
25       The  result  parameter required by this function must be a valid result
26       set returned by odbx_result() and must not has been  feed  to  odbx_re‐
27       sult_finish() before.
28
29       Valid  column  indices  for the requested column provided via pos start
30       with zero and end with the value returned by odbx_column_count()  minus
31       one.
32

RETURN VALUE

34       If a values less than zero is returned, an error occurred. Possible er‐
35       ror codes are listed in the error section and the application  can  re‐
36       trieve a textual message of the error by calling odbx_error().
37
38       A  positive  return  value  including zero indicates one of the SQL2003
39       compliant data types listed below. Before release 1.1.5 of the  OpenDBX
40       library,  types  were defined as ODBX_* instead of ODBX_TYPE_*. The old
41       definitions are kept for backward compatibility but shouldn't  be  used
42       any more. They will be removed at some point in the future.
43
44       Exact numeric values:
45
46       • ODBX_TYPE_BOOLEAN: True/false values
47
48       • ODBX_TYPE_SMALLINT: Signed 16 bit integer
49
50       • ODBX_TYPE_INTEGER: Signed 32 bit integer
51
52       • ODBX_TYPE_BIGINT: Signed 64 bit integer
53
54       • ODBX_TYPE_DECIMAL: Exact signed numeric values with user defined pre‐
55         cision
56
57       Approximate numeric values:
58
59       • ODBX_TYPE_REAL: Approximate numeric values (signed) with 32 bit  pre‐
60         cision
61
62       • ODBX_TYPE_DOUBLE:  Approximate  numeric  values  (signed) with 64 bit
63         precision
64
65       • ODBX_TYPE_FLOAT: Approximate numeric values (signed)  with  user  de‐
66         fined precision
67
68       String values:
69
70       • ODBX_TYPE_CHAR: Fixed number of characters
71
72       • ODBX_TYPE_NCHAR:  Fixed number of characters using a national charac‐
73         ter set
74
75       • ODBX_TYPE_VARCHAR: Variable number of characters
76
77       • ODBX_TYPE_NVARCHAR: Variable number of characters  using  a  national
78         character set
79
80       Large objects:
81
82       • ODBX_TYPE_CLOB: Large text object
83
84       • ODBX_TYPE_NCLOB: Large text object using a national character set
85
86       • ODBX_TYPE_XML: XML tree in text format
87
88       • ODBX_TYPE_BLOB: Large binary object
89
90       Date and time values:
91
92       • ODBX_TYPE_TIME: Time including hours, minutes and seconds
93
94       • ODBX_TYPE_TIME_TZ: Time with timezone information
95
96       • ODBX_TYPE_TIMESTAMP: Date and time
97
98       • ODBX_TYPE_TIMESTAMP_TZ: Date and time with timezone information
99
100       • ODBX_TYPE_DATE: Date including year, month and day
101
102       • ODBX_TYPE_INTERVAL: Date interval
103
104       Arrays and sets:
105
106       • ODBX_TYPE_ARRAY: Array of values
107
108       • ODBX_TYPE_MULTISET: Associative arrays
109
110       External links:
111
112       • ODBX_TYPE_DATALINK: URI locators like URL links
113
114       Vendor specific:
115
116       • ODBX_TYPE_UNKNOWN:  Vendor  specific data type without representation
117         in SQL2003
118

ERRORS

120       -ODBX_ERR_BACKEND
121              The native database library returned an error
122
123       -ODBX_ERR_PARAM
124              Either the result parameter is NULL respectively is  invalid  or
125              the value of pos is out of range
126

SEE ALSO

128       odbx_column_count(),  odbx_column_name(),  odbx_field_value(), odbx_re‐
129       sult()
130
131
132
133                                20 January 2022            odbx_column_type(3)
Impressum