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_NO_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 /* ------------------------------------------------------------------------
114  RDM specific connection attributes
115 */
116 #define SQL_ATTR_RDM_CAT_BUFFER (SQL_DRIVER_CONN_ATTR_BASE) /* SetCatalog */
117 #define SQL_ATTR_RDM_CAT_FILE (SQL_DRIVER_CONN_ATTR_BASE + 1) /* SetCatalogFromFile */
118 #define SQL_ATTR_RDM_ENCRYPT (SQL_DRIVER_CONN_ATTR_BASE + 2) /* encryption context set/get */
119 #define SQL_ATTR_RDM_REMOTE_NAME (SQL_DRIVER_CONN_ATTR_BASE + 3)
120 #define SQL_ATTR_RDM_SQL_OPTIONS (SQL_DRIVER_CONN_ATTR_BASE + 4)
121 #define SQL_ATTR_RDM_USE_CATALOG (SQL_DRIVER_CONN_ATTR_BASE + 5)
122 #define SQL_ATTR_RDM_LOCALE (SQL_DRIVER_CONN_ATTR_BASE + 6)
123 #define SQL_ATTR_RDM_OPTIMIZE_PARAMETERS (SQL_DRIVER_CONN_ATTR_BASE + 7) /* optimize param'd query */
124 #define SQL_ATTR_RDM_ROUNDING_MODE (SQL_DRIVER_CONN_ATTR_BASE + 8)
125 #define SQL_ATTR_RDM_STORAGE_MEDIA (SQL_DRIVER_CONN_ATTR_BASE + 9)
126 #define SQL_ATTR_RDM_TFS_HANDLE (SQL_DRIVER_CONN_ATTR_BASE + 10) /* TFS handle */
127 
129 #define SQL_ATTR_RDM_PACK_WRITE_CHUNK_SIZE (SQL_DRIVER_CONN_ATTR_BASE + 101)
130 #define SQL_ATTR_RDM_PACK_FILE_SIZE_MAX (SQL_DRIVER_CONN_ATTR_BASE + 102)
131 #define SQL_ATTR_RDM_DB_SIZE_MAX (SQL_DRIVER_CONN_ATTR_BASE + 103)
132 #define SQL_ATTR_RDM_VACUUM_PERCENTAGE (SQL_DRIVER_CONN_ATTR_BASE + 104)
133 #define SQL_ATTR_RDM_VACUUM_READ_CHUNK_SIZE (SQL_DRIVER_CONN_ATTR_BASE + 105)
134 #define SQL_ATTR_RDM_VACUUM_WRITE_CHUNK_SIZE (SQL_DRIVER_CONN_ATTR_BASE + 106)
135 #define SQL_ATTR_RDM_IDINDEX_FLUSH_THRESHOLD (SQL_DRIVER_CONN_ATTR_BASE + 107)
136 #define SQL_ATTR_RDM_IDINDEX_FLUSH_THRESHOLD_ON_CLOSE (SQL_DRIVER_CONN_ATTR_BASE + 108)
137 
138 /* ------------------------------------------------------------------------
139  * This indicates that a given numeric RDM connection attribute is not set
140 */
141 #define SQL_RDM_UNSET ((SQLULEN) -1)
142 
143 /* ------------------------------------------------------------------------
144  RDM specific statement attributes
145 */
146 #define SQL_ATTR_RDM_FILE_LINE 501 /* logical line number */
147 #define SQL_ATTR_RDM_FILE_NAME 502 /* logical file name */
148 
149 /* ------------------------------------------------------------------------
150  RDM specfic diagnostic area codes
151 
152  NOTE: ODBC-defined area codes are currently from 1 to 12 (sql.h)
153 */
154 #define SQL_DIAG_RDM_FILE_NAME 1001
155 #define SQL_DIAG_RDM_FILE_LINE 1002
156 #define SQL_DIAG_RDM_FILE_COLUMN 1003
157 
160 typedef enum
161 {
162  CT_LOCAL = 0,
165 } RDM_CONN_TYPE;
166 
167 #define SQL_CT_LOCAL ((SQLULEN) CT_LOCAL)
168 #define SQL_CT_REMOTE ((SQLULEN) CT_REMOTE)
169 #define SQL_CT_UNKNOWN ((SQLULEN) CT_UNKNOWN)
170 
173 #define SQL_ROUND_NEAREST_TIES_TO_EVEN ((SQLULEN) RDM_BCD_ROUND_NEAREST_TIES_TO_EVEN)
174 #define SQL_ROUND_NEAREST_TIES_AWAY_FROM_ZERO ((SQLULEN) RDM_BCD_ROUND_NEAREST_TIES_AWAY_FROM_ZERO)
175 #define SQL_ROUND_UP ((SQLULEN) RDM_BCD_ROUND_UP)
176 #define SQL_ROUND_DOWN ((SQLULEN) RDM_BCD_ROUND_DOWN)
177 #define SQL_ROUND_TOWARDS_ZERO ((SQLULEN) RDM_BCD_ROUND_TOWARDS_ZERO)
178 
179 #endif /* SQLRTYPES_H_INCLUDED_ */
180 
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:51
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:160
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:49
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:48