Products Support Documentation Download
sqlrtypes.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Raima Database Manager *
3  * *
4  * ODBC Support Package *
5  * -------------------- *
6  * Raima Database Manager extended SQL type definitions *
7  * *
8  * Copyright (c) 2011 Raima Inc. All rights reserved. *
9  * *
10  * Use of this software, whether in source code format, or in executable, *
11  * binary object code form, is governed by the Raima Inc. LICENSE *
12  * which is fully described in the LICENSE.TXT file, included within this *
13  * distribution of files. *
14  **************************************************************************/
15 
20 #if !defined(SQLRTYPES_H_INCLUDED_)
21 #define SQLRTYPES_H_INCLUDED_
22 
23 #include "sqltypes.h"
24 #include "rdmrowidtypes.h"
25 #include "rdmbcdtypes.h"
26 
27 /* ------------------------------------------------------------------------
28  RDM extension - const SQLPOINTER
29 */
30 typedef const void *SQLCPOINTER;
31 
32 #define SQL_EMPSTR ((SQLCHAR *) "")
33 #define SQL_EMPWSTR ((SQLWCHAR *) L"")
34 #define SQL_EMPTSTR ((SQLTCHAR *) RDM_T (""))
35 
36 #if defined(RDM_UNICODE)
37 #define SQL_TCHAR SQL_WCHAR
38 #define SQL_TVARCHAR SQL_WVARCHAR
39 #define SQL_TLONGVARCHAR SQL_WLONGVARCHAR
40 #else
41 #define SQL_TCHAR SQL_CHAR
42 #define SQL_TVARCHAR SQL_VARCHAR
43 #define SQL_TLONGVARCHAR SQL_LONGVARCHAR
44 #endif
45 
46 /* ------------------------------------------------------------------------
47  RDM extension - database address types
48 */
50 
51 #define SQL_ROWID SQL_DRIVER_SQL_TYPE_BASE
52 
53 #define SQL_RDM_TIMETZ (SQL_DRIVER_SQL_TYPE_BASE + 1)
54 #define SQL_RDM_TIMESTAMPTZ (SQL_DRIVER_SQL_TYPE_BASE + 2)
55 
56 #define SQL_C_ROWID SQL_ROWID
57 #define SQL_C_RDM_TIMETZ SQL_RDM_TIMETZ
58 #define SQL_C_RDM_TIMESTAMPTZ SQL_RDM_TIMESTAMPTZ
59 
60 typedef struct
61 {
69 
70 typedef struct
71 {
82 
83 /* ------------------------------------------------------------------------
84  Default precision and scale (note: default scale should be 0 by ODBC
85 */
86 #define SQL_RDM_DEF_PRECISION 32
87 #define SQL_RDM_DEF_SCALE 0
88 
89 /* ------------------------------------------------------------------------
90  RDM specific rdbcInitStmt() option
91 */
92 #define SQL_INIT 5
93 
94 /* ------------------------------------------------------------------------
95  Extended access modes for SQL_ATTR_ACCESS_MODE (connection attribute)
96 */
97 
98 /* These are defined in sqlext.h as the standard ODBC attribute values
99 #define SQL_MODE_READ_WRITE 0
100 #define SQL_MODE_READ_ONLY 1
101 */
102 #define SQL_MODE_EXCLUSIVE 2
103 #define SQL_MODE_READ_WRITE_APPEND 3
104 #define SQL_MODE_EXCLUSIVE_APPEND 4
105 #define SQL_MODE_READ_WRITE_CREAT 5
106 #define SQL_MODE_EXCLUSIVE_CREAT 6
107 #define SQL_MODE_READ_WRITE_CREAT_TRUNC 7
108 #define SQL_MODE_EXCLUSIVE_CREAT_TRUNC 8
109 #define SQL_MODE_READ_WRITE_CREAT_EXCL 9
110 #define SQL_MODE_EXCLUSIVE_CREAT_EXCL 10
111 
112 /* ------------------------------------------------------------------------
113  RDM specific connection attributes
114 */
115 #define SQL_ATTR_RDM_CAT_BUFFER (SQL_DRIVER_CONN_ATTR_BASE) /* SetCatalog */
116 #define SQL_ATTR_RDM_CAT_FILE \
117  (SQL_DRIVER_CONN_ATTR_BASE + 1) /* SetCatalogFromFile */
118 #define SQL_ATTR_RDM_ENCRYPT \
119  (SQL_DRIVER_CONN_ATTR_BASE + 2) /* encryption context set/get */
120 #define SQL_ATTR_RDM_REMOTE_NAME (SQL_DRIVER_CONN_ATTR_BASE + 3)
121 #define SQL_ATTR_RDM_SQL_OPTIONS (SQL_DRIVER_CONN_ATTR_BASE + 4)
122 #define SQL_ATTR_RDM_USE_CATALOG (SQL_DRIVER_CONN_ATTR_BASE + 5)
123 #define SQL_ATTR_RDM_LOCALE (SQL_DRIVER_CONN_ATTR_BASE + 6)
124 #define SQL_ATTR_RDM_OPTIMIZE_PARAMETERS \
125  (SQL_DRIVER_CONN_ATTR_BASE + 7) /* optimize param'd query */
126 #define SQL_ATTR_RDM_ROUNDING_MODE (SQL_DRIVER_CONN_ATTR_BASE + 8)
127 #define SQL_ATTR_RDM_STORAGE_MEDIA (SQL_DRIVER_CONN_ATTR_BASE + 9)
128 #define SQL_ATTR_RDM_TFS_HANDLE \
129  (SQL_DRIVER_CONN_ATTR_BASE + 10) /* TFS handle */
130 
132 #define SQL_ATTR_RDM_PACK_WRITE_CHUNK_SIZE (SQL_DRIVER_CONN_ATTR_BASE + 101)
133 #define SQL_ATTR_RDM_PACK_FILE_SIZE_MAX (SQL_DRIVER_CONN_ATTR_BASE + 102)
134 #define SQL_ATTR_RDM_DB_SIZE_MAX (SQL_DRIVER_CONN_ATTR_BASE + 103)
135 #define SQL_ATTR_RDM_VACUUM_PERCENTAGE (SQL_DRIVER_CONN_ATTR_BASE + 104)
136 #define SQL_ATTR_RDM_VACUUM_READ_CHUNK_SIZE (SQL_DRIVER_CONN_ATTR_BASE + 105)
137 #define SQL_ATTR_RDM_VACUUM_WRITE_CHUNK_SIZE (SQL_DRIVER_CONN_ATTR_BASE + 106)
138 #define SQL_ATTR_RDM_IDINDEX_FLUSH_THRESHOLD (SQL_DRIVER_CONN_ATTR_BASE + 107)
139 #define SQL_ATTR_RDM_IDINDEX_FLUSH_THRESHOLD_ON_CLOSE \
140  (SQL_DRIVER_CONN_ATTR_BASE + 108)
141 
142 /* ------------------------------------------------------------------------
143  * This indicates that a given numeric RDM connection attribute is not set
144  */
145 #define SQL_RDM_UNSET ((SQLULEN) -1)
146 
147 /* ------------------------------------------------------------------------
148  RDM specific statement attributes
149 */
150 #define SQL_ATTR_RDM_FILE_LINE 501 /* logical line number */
151 #define SQL_ATTR_RDM_FILE_NAME 502 /* logical file name */
152 
153 /* ------------------------------------------------------------------------
154  RDM specfic diagnostic area codes
155 
156  NOTE: ODBC-defined area codes are currently from 1 to 12 (sql.h)
157 */
158 #define SQL_DIAG_RDM_FILE_NAME 1001
159 #define SQL_DIAG_RDM_FILE_LINE 1002
160 #define SQL_DIAG_RDM_FILE_COLUMN 1003
161 
164 typedef enum
165 {
166  CT_LOCAL = 0,
169 } RDM_CONN_TYPE;
170 
171 #define SQL_CT_LOCAL ((SQLULEN) CT_LOCAL)
172 #define SQL_CT_REMOTE ((SQLULEN) CT_REMOTE)
173 #define SQL_CT_UNKNOWN ((SQLULEN) CT_UNKNOWN)
174 
177 #define SQL_ROUND_NEAREST_TIES_TO_EVEN \
178  ((SQLULEN) RDM_BCD_ROUND_NEAREST_TIES_TO_EVEN)
179 #define SQL_ROUND_NEAREST_TIES_AWAY_FROM_ZERO \
180  ((SQLULEN) RDM_BCD_ROUND_NEAREST_TIES_AWAY_FROM_ZERO)
181 #define SQL_ROUND_UP ((SQLULEN) RDM_BCD_ROUND_UP)
182 #define SQL_ROUND_DOWN ((SQLULEN) RDM_BCD_ROUND_DOWN)
183 #define SQL_ROUND_TOWARDS_ZERO ((SQLULEN) RDM_BCD_ROUND_TOWARDS_ZERO)
184 
185 #endif /* SQLRTYPES_H_INCLUDED_ */
SQLSMALLINT year
Definition: sqlrtypes.h:72
SQLUSMALLINT month
Definition: sqlrtypes.h:73
SQLUSMALLINT day
Definition: sqlrtypes.h:74
SQLUSMALLINT second
Definition: sqlrtypes.h:77
SQLUINTEGER fraction
Definition: sqlrtypes.h:78
Header for the types used in ODBC.
uint32_t SQLUINTEGER
Definition: sqltypes.h:56
SQLUSMALLINT second
Definition: sqlrtypes.h:64
SQLUSMALLINT minute
Definition: sqlrtypes.h:63
const void * SQLCPOINTER
Definition: sqlrtypes.h:30
SQLSMALLINT timezone_hour
Definition: sqlrtypes.h:66
RDM_CONN_TYPE
RDM specific connection type values.
Definition: sqlrtypes.h:164
SQLSMALLINT timezone_minute
Definition: sqlrtypes.h:80
SQLUSMALLINT hour
Definition: sqlrtypes.h:62
RDM_ROWID_T SQLROWID
Definition: sqlrtypes.h:49
SQLSMALLINT timezone_minute
Definition: sqlrtypes.h:67
Header for Binary-coded decimal (BCD) types.
uint16_t SQLUSMALLINT
Definition: sqltypes.h:54
SQLUINTEGER fraction
Definition: sqlrtypes.h:65
uint64_t RDM_ROWID_T
Definition: rdmrowidtypes.h:21
Header for row ID types.
SQLSMALLINT timezone_hour
Definition: sqlrtypes.h:79
SQLUSMALLINT hour
Definition: sqlrtypes.h:75
SQLUSMALLINT minute
Definition: sqlrtypes.h:76
int16_t SQLSMALLINT
Definition: sqltypes.h:53