]>
Commit | Line | Data |
---|---|---|
d76fe38b RR |
1 | /* |
2 | * | |
3 | * isqlext.h | |
4 | * | |
5 | * $Id$ | |
6 | * | |
7 | * iODBC defines (ext) | |
8 | * | |
9 | * The iODBC driver manager. | |
c67b773e DW |
10 | * |
11 | * Copyright (C) 1995 by Ke Jin <kejin@empress.com> | |
d76fe38b RR |
12 | * |
13 | * This library is free software; you can redistribute it and/or | |
14 | * modify it under the terms of the GNU Library General Public | |
15 | * License as published by the Free Software Foundation; either | |
16 | * version 2 of the License, or (at your option) any later version. | |
17 | * | |
18 | * This library is distributed in the hope that it will be useful, | |
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 | * Library General Public License for more details. | |
22 | * | |
23 | * You should have received a copy of the GNU Library General Public | |
24 | * License along with this library; if not, write to the Free | |
25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
26 | */ | |
7beb59f3 WS |
27 | #ifndef _ISQLEXT_H |
28 | #define _ISQLEXT_H | |
d76fe38b | 29 | |
c67b773e | 30 | #include "wx/isql.h" |
d76fe38b RR |
31 | |
32 | /* | |
33 | * Generic constants | |
34 | */ | |
7beb59f3 | 35 | #define SQL_MAX_OPTION_STRING_LENGTH 256 |
d76fe38b RR |
36 | |
37 | /* | |
38 | * Additional return codes | |
39 | */ | |
7beb59f3 WS |
40 | #define SQL_STILL_EXECUTING 2 |
41 | #define SQL_NEED_DATA 99 | |
d76fe38b RR |
42 | |
43 | /* | |
44 | * SQL extended datatypes | |
45 | */ | |
7beb59f3 WS |
46 | #define SQL_DATE 9 |
47 | #define SQL_TIME 10 | |
48 | #define SQL_TIMESTAMP 11 | |
49 | #define SQL_LONGVARCHAR (-1) | |
50 | #define SQL_BINARY (-2) | |
51 | #define SQL_VARBINARY (-3) | |
52 | #define SQL_LONGVARBINARY (-4) | |
53 | #define SQL_BIGINT (-5) | |
54 | #define SQL_TINYINT (-6) | |
55 | #define SQL_BIT (-7) | |
56 | ||
57 | #define SQL_INTERVAL_YEAR (-80) | |
58 | #define SQL_INTERVAL_MONTH (-81) | |
59 | #define SQL_INTERVAL_YEAR_TO_MONTH (-82) | |
60 | #define SQL_INTERVAL_DAY (-83) | |
61 | #define SQL_INTERVAL_HOUR (-84) | |
62 | #define SQL_INTERVAL_MINUTE (-85) | |
63 | #define SQL_INTERVAL_SECOND (-86) | |
64 | #define SQL_INTERVAL_DAY_TO_HOUR (-87) | |
65 | #define SQL_INTERVAL_DAY_TO_MINUTE (-88) | |
66 | #define SQL_INTERVAL_DAY_TO_SECOND (-89) | |
67 | #define SQL_INTERVAL_HOUR_TO_MINUTE (-90) | |
68 | #define SQL_INTERVAL_HOUR_TO_SECOND (-91) | |
69 | #define SQL_INTERVAL_MINUTE_TO_SECOND (-92) | |
70 | #define SQL_UNICODE (-95) | |
71 | ||
72 | #define SQL_TYPE_DRIVER_START SQL_INTERVAL_YEAR | |
73 | #define SQL_TYPE_DRIVER_END SQL_UNICODE | |
74 | ||
75 | #define SQL_SIGNED_OFFSET (-20) | |
76 | #define SQL_UNSIGNED_OFFSET (-22) | |
d76fe38b RR |
77 | |
78 | /* | |
79 | * C datatype to SQL datatype mapping | |
80 | */ | |
7beb59f3 WS |
81 | #define SQL_C_DATE SQL_DATE |
82 | #define SQL_C_TIME SQL_TIME | |
83 | #define SQL_C_TIMESTAMP SQL_TIMESTAMP | |
84 | #define SQL_C_BINARY SQL_BINARY | |
85 | #define SQL_C_BIT SQL_BIT | |
86 | #define SQL_C_TINYINT SQL_TINYINT | |
87 | #define SQL_C_SLONG SQL_C_LONG+SQL_SIGNED_OFFSET | |
88 | #define SQL_C_SSHORT SQL_C_SHORT+SQL_SIGNED_OFFSET | |
89 | #define SQL_C_STINYINT SQL_TINYINT+SQL_SIGNED_OFFSET | |
90 | #define SQL_C_ULONG SQL_C_LONG+SQL_UNSIGNED_OFFSET | |
91 | #define SQL_C_USHORT SQL_C_SHORT+SQL_UNSIGNED_OFFSET | |
92 | #define SQL_C_UTINYINT SQL_TINYINT+SQL_UNSIGNED_OFFSET | |
93 | #define SQL_C_BOOKMARK SQL_C_ULONG | |
d76fe38b RR |
94 | |
95 | /* | |
96 | * Extended data types override sql.h defined | |
97 | */ | |
7beb59f3 WS |
98 | #undef SQL_TYPE_MIN |
99 | #define SQL_TYPE_MIN SQL_BIT | |
100 | #define SQL_ALL_TYPES 0 | |
d76fe38b RR |
101 | |
102 | /* | |
103 | * SQL portable types for C - DATE, TIME, TIMESTAMP | |
104 | */ | |
105 | typedef struct _DATE_STRUCT | |
106 | { | |
107 | SWORD year; | |
108 | UWORD month; | |
109 | UWORD day; | |
110 | } | |
111 | DATE_STRUCT; | |
112 | ||
113 | typedef struct _TIME_STRUCT | |
114 | { | |
115 | UWORD hour; | |
116 | UWORD minute; | |
117 | UWORD second; | |
118 | } | |
119 | TIME_STRUCT; | |
120 | ||
121 | typedef struct _TIMESTAMP_STRUCT | |
122 | { | |
123 | SWORD year; | |
124 | UWORD month; | |
125 | UWORD day; | |
126 | UWORD hour; | |
127 | UWORD minute; | |
128 | UWORD second; | |
129 | UDWORD fraction; | |
130 | } | |
131 | TIMESTAMP_STRUCT; | |
132 | ||
7beb59f3 | 133 | typedef unsigned long int BOOKMARK; |
d76fe38b RR |
134 | |
135 | /* | |
136 | * ---------------------------------------------------------------------- | |
137 | * Level 1 Functions | |
138 | * ---------------------------------------------------------------------- | |
139 | */ | |
140 | ||
141 | /* | |
142 | * SQLDriverConnect | |
143 | */ | |
7beb59f3 WS |
144 | #define SQL_DRIVER_NOPROMPT 0 |
145 | #define SQL_DRIVER_COMPLETE 1 | |
146 | #define SQL_DRIVER_PROMPT 2 | |
147 | #define SQL_DRIVER_COMPLETE_REQUIRED 3 | |
d76fe38b RR |
148 | |
149 | /* | |
150 | * SQLGetData | |
151 | */ | |
7beb59f3 | 152 | #define SQL_NO_TOTAL (-4) |
d76fe38b RR |
153 | |
154 | /* | |
155 | * SQLBindParameter | |
156 | */ | |
7beb59f3 WS |
157 | #define SQL_DEFAULT_PARAM (-5) |
158 | #define SQL_IGNORE (-6) | |
159 | #define SQL_LEN_DATA_AT_EXEC_OFFSET (-100) | |
160 | #define SQL_LEN_DATA_AT_EXEC(length) (-length+SQL_LEN_DATA_AT_EXEC_OFFSET) | |
d76fe38b RR |
161 | |
162 | /* | |
163 | * SQLGetFunctions | |
164 | */ | |
7beb59f3 WS |
165 | #define SQL_API_SQLALLOCCONNECT 1 /* Core Functions */ |
166 | #define SQL_API_SQLALLOCENV 2 | |
167 | #define SQL_API_SQLALLOCSTMT 3 | |
168 | #define SQL_API_SQLBINDCOL 4 | |
169 | #define SQL_API_SQLCANCEL 5 | |
170 | #define SQL_API_SQLCOLATTRIBUTES 6 | |
171 | #define SQL_API_SQLCONNECT 7 | |
172 | #define SQL_API_SQLDESCRIBECOL 8 | |
173 | #define SQL_API_SQLDISCONNECT 9 | |
174 | #define SQL_API_SQLERROR 10 | |
175 | #define SQL_API_SQLEXECDIRECT 11 | |
176 | #define SQL_API_SQLEXECUTE 12 | |
177 | #define SQL_API_SQLFETCH 13 | |
178 | #define SQL_API_SQLFREECONNECT 14 | |
179 | #define SQL_API_SQLFREEENV 15 | |
180 | #define SQL_API_SQLFREESTMT 16 | |
181 | #define SQL_API_SQLGETCURSORNAME 17 | |
182 | #define SQL_API_SQLNUMRESULTCOLS 18 | |
183 | #define SQL_API_SQLPREPARE 19 | |
184 | #define SQL_API_SQLROWCOUNT 20 | |
185 | #define SQL_API_SQLSETCURSORNAME 21 | |
186 | #define SQL_API_SQLSETPARAM 22 | |
187 | #define SQL_API_SQLTRANSACT 23 | |
188 | ||
189 | #define SQL_NUM_FUNCTIONS 23 | |
190 | ||
191 | #define SQL_EXT_API_START 40 | |
192 | ||
193 | #define SQL_API_SQLCOLUMNS 40 /* Level 1 Functions */ | |
194 | #define SQL_API_SQLDRIVERCONNECT 41 | |
195 | #define SQL_API_SQLGETCONNECTOPTION 42 | |
196 | #define SQL_API_SQLGETDATA 43 | |
197 | #define SQL_API_SQLGETFUNCTIONS 44 | |
198 | #define SQL_API_SQLGETINFO 45 | |
199 | #define SQL_API_SQLGETSTMTOPTION 46 | |
200 | #define SQL_API_SQLGETTYPEINFO 47 | |
201 | #define SQL_API_SQLPARAMDATA 48 | |
202 | #define SQL_API_SQLPUTDATA 49 | |
203 | #define SQL_API_SQLSETCONNECTOPTION 50 | |
204 | #define SQL_API_SQLSETSTMTOPTION 51 | |
205 | #define SQL_API_SQLSPECIALCOLUMNS 52 | |
206 | #define SQL_API_SQLSTATISTICS 53 | |
207 | #define SQL_API_SQLTABLES 54 | |
208 | ||
209 | #define SQL_API_SQLBROWSECONNECT 55 /* Level 2 Functions */ | |
210 | #define SQL_API_SQLCOLUMNPRIVILEGES 56 | |
211 | #define SQL_API_SQLDATASOURCES 57 | |
212 | #define SQL_API_SQLDESCRIBEPARAM 58 | |
213 | #define SQL_API_SQLEXTENDEDFETCH 59 | |
214 | #define SQL_API_SQLFOREIGNKEYS 60 | |
215 | #define SQL_API_SQLMORERESULTS 61 | |
216 | #define SQL_API_SQLNATIVESQL 62 | |
217 | #define SQL_API_SQLNUMPARAMS 63 | |
218 | #define SQL_API_SQLPARAMOPTIONS 64 | |
219 | #define SQL_API_SQLPRIMARYKEYS 65 | |
220 | #define SQL_API_SQLPROCEDURECOLUMNS 66 | |
221 | #define SQL_API_SQLPROCEDURES 67 | |
222 | #define SQL_API_SQLSETPOS 68 | |
223 | #define SQL_API_SQLSETSCROLLOPTIONS 69 | |
224 | #define SQL_API_SQLTABLEPRIVILEGES 70 | |
225 | ||
226 | #define SQL_API_SQLDRIVERS 71 | |
227 | #define SQL_API_SQLBINDPARAMETER 72 | |
228 | #define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER | |
229 | ||
230 | #define SQL_API_ALL_FUNCTIONS 0 | |
d76fe38b RR |
231 | |
232 | #define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1) | |
233 | ||
234 | /* | |
235 | * SQLGetInfo | |
236 | */ | |
7beb59f3 WS |
237 | #define SQL_INFO_FIRST 0 |
238 | #define SQL_ACTIVE_CONNECTIONS 0 | |
239 | #define SQL_ACTIVE_STATEMENTS 1 | |
240 | #define SQL_DATA_SOURCE_NAME 2 | |
241 | #define SQL_DRIVER_HDBC 3 | |
242 | #define SQL_DRIVER_HENV 4 | |
243 | #define SQL_DRIVER_HSTMT 5 | |
244 | #define SQL_DRIVER_NAME 6 | |
245 | #define SQL_DRIVER_VER 7 | |
246 | #define SQL_FETCH_DIRECTION 8 | |
247 | #define SQL_ODBC_API_CONFORMANCE 9 | |
248 | #define SQL_ODBC_VER 10 | |
249 | #define SQL_ROW_UPDATES 11 | |
250 | #define SQL_ODBC_SAG_CLI_CONFORMANCE 12 | |
251 | #define SQL_SERVER_NAME 13 | |
252 | #define SQL_SEARCH_PATTERN_ESCAPE 14 | |
253 | #define SQL_ODBC_SQL_CONFORMANCE 15 | |
254 | #define SQL_DBMS_NAME 17 | |
255 | #define SQL_DBMS_VER 18 | |
256 | #define SQL_ACCESSIBLE_TABLES 19 | |
257 | #define SQL_ACCESSIBLE_PROCEDURES 20 | |
258 | #define SQL_PROCEDURES 21 | |
259 | #define SQL_CONCAT_NULL_BEHAVIOR 22 | |
260 | #define SQL_CURSOR_COMMIT_BEHAVIOR 23 | |
261 | #define SQL_CURSOR_ROLLBACK_BEHAVIOR 24 | |
262 | #define SQL_DATA_SOURCE_READ_ONLY 25 | |
263 | #define SQL_DEFAULT_TXN_ISOLATION 26 | |
264 | #define SQL_EXPRESSIONS_IN_ORDERBY 27 | |
265 | #define SQL_IDENTIFIER_CASE 28 | |
266 | #define SQL_IDENTIFIER_QUOTE_CHAR 29 | |
267 | #define SQL_MAX_COLUMN_NAME_LEN 30 | |
268 | #define SQL_MAX_CURSOR_NAME_LEN 31 | |
269 | #define SQL_MAX_OWNER_NAME_LEN 32 | |
270 | #define SQL_MAX_PROCEDURE_NAME_LEN 33 | |
271 | #define SQL_MAX_QUALIFIER_NAME_LEN 34 | |
272 | #define SQL_MAX_TABLE_NAME_LEN 35 | |
273 | #define SQL_MULT_RESULT_SETS 36 | |
274 | #define SQL_MULTIPLE_ACTIVE_TXN 37 | |
275 | #define SQL_OUTER_JOINS 38 | |
276 | #define SQL_OWNER_TERM 39 | |
277 | #define SQL_PROCEDURE_TERM 40 | |
278 | #define SQL_QUALIFIER_NAME_SEPARATOR 41 | |
279 | #define SQL_QUALIFIER_TERM 42 | |
280 | #define SQL_SCROLL_CONCURRENCY 43 | |
281 | #define SQL_SCROLL_OPTIONS 44 | |
282 | #define SQL_TABLE_TERM 45 | |
283 | #define SQL_TXN_CAPABLE 46 | |
284 | #define SQL_USER_NAME 47 | |
285 | #define SQL_CONVERT_FUNCTIONS 48 | |
286 | #define SQL_NUMERIC_FUNCTIONS 49 | |
287 | #define SQL_STRING_FUNCTIONS 50 | |
288 | #define SQL_SYSTEM_FUNCTIONS 51 | |
289 | #define SQL_TIMEDATE_FUNCTIONS 52 | |
290 | #define SQL_CONVERT_BIGINT 53 | |
291 | #define SQL_CONVERT_BINARY 54 | |
292 | #define SQL_CONVERT_BIT 55 | |
293 | #define SQL_CONVERT_CHAR 56 | |
294 | #define SQL_CONVERT_DATE 57 | |
295 | #define SQL_CONVERT_DECIMAL 58 | |
296 | #define SQL_CONVERT_DOUBLE 59 | |
297 | #define SQL_CONVERT_FLOAT 60 | |
298 | #define SQL_CONVERT_INTEGER 61 | |
299 | #define SQL_CONVERT_LONGVARCHAR 62 | |
300 | #define SQL_CONVERT_NUMERIC 63 | |
301 | #define SQL_CONVERT_REAL 64 | |
302 | #define SQL_CONVERT_SMALLINT 65 | |
303 | #define SQL_CONVERT_TIME 66 | |
304 | #define SQL_CONVERT_TIMESTAMP 67 | |
305 | #define SQL_CONVERT_TINYINT 68 | |
306 | #define SQL_CONVERT_VARBINARY 69 | |
307 | #define SQL_CONVERT_VARCHAR 70 | |
308 | #define SQL_CONVERT_LONGVARBINARY 71 | |
309 | #define SQL_TXN_ISOLATION_OPTION 72 | |
310 | #define SQL_ODBC_SQL_OPT_IEF 73 | |
d76fe38b RR |
311 | |
312 | /* | |
313 | * ODBC SDK 1.0 Additions | |
314 | */ | |
7beb59f3 WS |
315 | #define SQL_CORRELATION_NAME 74 |
316 | #define SQL_NON_NULLABLE_COLUMNS 75 | |
d76fe38b RR |
317 | |
318 | /* | |
319 | * ODBC SDK 2.0 Additions | |
320 | */ | |
7beb59f3 WS |
321 | #define SQL_DRIVER_HLIB 76 |
322 | #define SQL_DRIVER_ODBC_VER 77 | |
323 | #define SQL_LOCK_TYPES 78 | |
324 | #define SQL_POS_OPERATIONS 79 | |
325 | #define SQL_POSITIONED_STATEMENTS 80 | |
326 | #define SQL_GETDATA_EXTENSIONS 81 | |
327 | #define SQL_BOOKMARK_PERSISTENCE 82 | |
328 | #define SQL_STATIC_SENSITIVITY 83 | |
329 | #define SQL_FILE_USAGE 84 | |
330 | #define SQL_NULL_COLLATION 85 | |
331 | #define SQL_ALTER_TABLE 86 | |
332 | #define SQL_COLUMN_ALIAS 87 | |
333 | #define SQL_GROUP_BY 88 | |
334 | #define SQL_KEYWORDS 89 | |
335 | #define SQL_ORDER_BY_COLUMNS_IN_SELECT 90 | |
336 | #define SQL_OWNER_USAGE 91 | |
337 | #define SQL_QUALIFIER_USAGE 92 | |
338 | #define SQL_QUOTED_IDENTIFIER_CASE 93 | |
339 | #define SQL_SPECIAL_CHARACTERS 94 | |
340 | #define SQL_SUBQUERIES 95 | |
341 | #define SQL_UNION 96 | |
342 | #define SQL_MAX_COLUMNS_IN_GROUP_BY 97 | |
343 | #define SQL_MAX_COLUMNS_IN_INDEX 98 | |
344 | #define SQL_MAX_COLUMNS_IN_ORDER_BY 99 | |
345 | #define SQL_MAX_COLUMNS_IN_SELECT 100 | |
346 | #define SQL_MAX_COLUMNS_IN_TABLE 101 | |
347 | #define SQL_MAX_INDEX_SIZE 102 | |
348 | #define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103 | |
349 | #define SQL_MAX_ROW_SIZE 104 | |
350 | #define SQL_MAX_STATEMENT_LEN 105 | |
351 | #define SQL_MAX_TABLES_IN_SELECT 106 | |
352 | #define SQL_MAX_USER_NAME_LEN 107 | |
353 | #define SQL_MAX_CHAR_LITERAL_LEN 108 | |
354 | #define SQL_TIMEDATE_ADD_INTERVALS 109 | |
355 | #define SQL_TIMEDATE_DIFF_INTERVALS 110 | |
356 | #define SQL_NEED_LONG_DATA_LEN 111 | |
357 | #define SQL_MAX_BINARY_LITERAL_LEN 112 | |
358 | #define SQL_LIKE_ESCAPE_CLAUSE 113 | |
359 | #define SQL_QUALIFIER_LOCATION 114 | |
d76fe38b RR |
360 | |
361 | /* | |
362 | * ODBC SDK 2.01 Additions | |
363 | */ | |
7beb59f3 | 364 | #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */ |
d76fe38b | 365 | |
7beb59f3 WS |
366 | #define SQL_INFO_LAST SQL_QUALIFIER_LOCATION |
367 | #define SQL_INFO_DRIVER_START 1000 | |
d76fe38b RR |
368 | |
369 | ||
370 | /* | |
371 | * SQL_CONVERT_* bitmask values | |
372 | */ | |
7beb59f3 WS |
373 | #define SQL_CVT_CHAR 0x00000001L |
374 | #define SQL_CVT_NUMERIC 0x00000002L | |
375 | #define SQL_CVT_DECIMAL 0x00000004L | |
376 | #define SQL_CVT_INTEGER 0x00000008L | |
377 | #define SQL_CVT_SMALLINT 0x00000010L | |
378 | #define SQL_CVT_FLOAT 0x00000020L | |
379 | #define SQL_CVT_REAL 0x00000040L | |
380 | #define SQL_CVT_DOUBLE 0x00000080L | |
381 | #define SQL_CVT_VARCHAR 0x00000100L | |
382 | #define SQL_CVT_LONGVARCHAR 0x00000200L | |
383 | #define SQL_CVT_BINARY 0x00000400L | |
384 | #define SQL_CVT_VARBINARY 0x00000800L | |
385 | #define SQL_CVT_BIT 0x00001000L | |
386 | #define SQL_CVT_TINYINT 0x00002000L | |
387 | #define SQL_CVT_BIGINT 0x00004000L | |
388 | #define SQL_CVT_DATE 0x00008000L | |
389 | #define SQL_CVT_TIME 0x00010000L | |
390 | #define SQL_CVT_TIMESTAMP 0x00020000L | |
391 | #define SQL_CVT_LONGVARBINARY 0x00040000L | |
d76fe38b RR |
392 | |
393 | /* | |
394 | * SQL_CONVERT_FUNCTIONS | |
395 | */ | |
7beb59f3 | 396 | #define SQL_FN_CVT_CONVERT 0x00000001L |
d76fe38b RR |
397 | |
398 | /* | |
399 | * SQL_STRING_FUNCTIONS | |
400 | */ | |
7beb59f3 WS |
401 | #define SQL_FN_STR_CONCAT 0x00000001L |
402 | #define SQL_FN_STR_INSERT 0x00000002L | |
403 | #define SQL_FN_STR_LEFT 0x00000004L | |
404 | #define SQL_FN_STR_LTRIM 0x00000008L | |
405 | #define SQL_FN_STR_LENGTH 0x00000010L | |
406 | #define SQL_FN_STR_LOCATE 0x00000020L | |
407 | #define SQL_FN_STR_LCASE 0x00000040L | |
408 | #define SQL_FN_STR_REPEAT 0x00000080L | |
409 | #define SQL_FN_STR_REPLACE 0x00000100L | |
410 | #define SQL_FN_STR_RIGHT 0x00000200L | |
411 | #define SQL_FN_STR_RTRIM 0x00000400L | |
412 | #define SQL_FN_STR_SUBSTRING 0x00000800L | |
413 | #define SQL_FN_STR_UCASE 0x00001000L | |
414 | #define SQL_FN_STR_ASCII 0x00002000L | |
415 | #define SQL_FN_STR_CHAR 0x00004000L | |
416 | #define SQL_FN_STR_DIFFERENCE 0x00008000L | |
417 | #define SQL_FN_STR_LOCATE_2 0x00010000L | |
418 | #define SQL_FN_STR_SOUNDEX 0x00020000L | |
419 | #define SQL_FN_STR_SPACE 0x00040000L | |
d76fe38b RR |
420 | |
421 | /* | |
422 | * SQL_NUMERIC_FUNCTIONS | |
423 | */ | |
7beb59f3 WS |
424 | #define SQL_FN_NUM_ABS 0x00000001L |
425 | #define SQL_FN_NUM_ACOS 0x00000002L | |
426 | #define SQL_FN_NUM_ASIN 0x00000004L | |
427 | #define SQL_FN_NUM_ATAN 0x00000008L | |
428 | #define SQL_FN_NUM_ATAN2 0x00000010L | |
429 | #define SQL_FN_NUM_CEILING 0x00000020L | |
430 | #define SQL_FN_NUM_COS 0x00000040L | |
431 | #define SQL_FN_NUM_COT 0x00000080L | |
432 | #define SQL_FN_NUM_EXP 0x00000100L | |
433 | #define SQL_FN_NUM_FLOOR 0x00000200L | |
434 | #define SQL_FN_NUM_LOG 0x00000400L | |
435 | #define SQL_FN_NUM_MOD 0x00000800L | |
436 | #define SQL_FN_NUM_SIGN 0x00001000L | |
437 | #define SQL_FN_NUM_SIN 0x00002000L | |
438 | #define SQL_FN_NUM_SQRT 0x00004000L | |
439 | #define SQL_FN_NUM_TAN 0x00008000L | |
440 | #define SQL_FN_NUM_PI 0x00010000L | |
441 | #define SQL_FN_NUM_RAND 0x00020000L | |
442 | #define SQL_FN_NUM_DEGREES 0x00040000L | |
443 | #define SQL_FN_NUM_LOG10 0x00080000L | |
444 | #define SQL_FN_NUM_POWER 0x00100000L | |
445 | #define SQL_FN_NUM_RADIANS 0x00200000L | |
446 | #define SQL_FN_NUM_ROUND 0x00400000L | |
447 | #define SQL_FN_NUM_TRUNCATE 0x00800000L | |
d76fe38b RR |
448 | |
449 | /* | |
450 | * SQL_TIMEDATE_FUNCTIONS | |
451 | */ | |
7beb59f3 WS |
452 | #define SQL_FN_TD_NOW 0x00000001L |
453 | #define SQL_FN_TD_CURDATE 0x00000002L | |
454 | #define SQL_FN_TD_DAYOFMONTH 0x00000004L | |
455 | #define SQL_FN_TD_DAYOFWEEK 0x00000008L | |
456 | #define SQL_FN_TD_DAYOFYEAR 0x00000010L | |
457 | #define SQL_FN_TD_MONTH 0x00000020L | |
458 | #define SQL_FN_TD_QUARTER 0x00000040L | |
459 | #define SQL_FN_TD_WEEK 0x00000080L | |
460 | #define SQL_FN_TD_YEAR 0x00000100L | |
461 | #define SQL_FN_TD_CURTIME 0x00000200L | |
462 | #define SQL_FN_TD_HOUR 0x00000400L | |
463 | #define SQL_FN_TD_MINUTE 0x00000800L | |
464 | #define SQL_FN_TD_SECOND 0x00001000L | |
465 | #define SQL_FN_TD_TIMESTAMPADD 0x00002000L | |
466 | #define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L | |
467 | #define SQL_FN_TD_DAYNAME 0x00008000L | |
468 | #define SQL_FN_TD_MONTHNAME 0x00010000L | |
d76fe38b RR |
469 | |
470 | /* | |
471 | * SQL_SYSTEM_FUNCTIONS | |
472 | */ | |
7beb59f3 WS |
473 | #define SQL_FN_SYS_USERNAME 0x00000001L |
474 | #define SQL_FN_SYS_DBNAME 0x00000002L | |
475 | #define SQL_FN_SYS_IFNULL 0x00000004L | |
d76fe38b RR |
476 | |
477 | /* | |
478 | * SQL_TIMEDATE_ADD_INTERVALS | |
479 | * SQL_TIMEDATE_DIFF_INTERVALS | |
480 | */ | |
7beb59f3 WS |
481 | #define SQL_FN_TSI_FRAC_SECOND 0x00000001L |
482 | #define SQL_FN_TSI_SECOND 0x00000002L | |
483 | #define SQL_FN_TSI_MINUTE 0x00000004L | |
484 | #define SQL_FN_TSI_HOUR 0x00000008L | |
485 | #define SQL_FN_TSI_DAY 0x00000010L | |
486 | #define SQL_FN_TSI_WEEK 0x00000020L | |
487 | #define SQL_FN_TSI_MONTH 0x00000040L | |
488 | #define SQL_FN_TSI_QUARTER 0x00000080L | |
489 | #define SQL_FN_TSI_YEAR 0x00000100L | |
d76fe38b RR |
490 | |
491 | /* | |
492 | * SQL_ODBC_API_CONFORMANCE | |
493 | */ | |
7beb59f3 WS |
494 | #define SQL_OAC_NONE 0x0000 |
495 | #define SQL_OAC_LEVEL1 0x0001 | |
496 | #define SQL_OAC_LEVEL2 0x0002 | |
d76fe38b RR |
497 | |
498 | /* | |
499 | * SQL_ODBC_SAG_CLI_CONFORMANCE | |
500 | */ | |
7beb59f3 WS |
501 | #define SQL_OSCC_NOT_COMPLIANT 0x0000 |
502 | #define SQL_OSCC_COMPLIANT 0x0001 | |
d76fe38b RR |
503 | |
504 | /* | |
505 | * SQL_ODBC_SQL_CONFORMANCE | |
506 | */ | |
7beb59f3 WS |
507 | #define SQL_OSC_MINIMUM 0x0000 |
508 | #define SQL_OSC_CORE 0x0001 | |
509 | #define SQL_OSC_EXTENDED 0x0002 | |
d76fe38b RR |
510 | |
511 | /* | |
512 | * SQL_CONCAT_NULL_BEHAVIOR | |
513 | */ | |
7beb59f3 WS |
514 | #define SQL_CB_NULL 0x0000 |
515 | #define SQL_CB_NON_NULL 0x0001 | |
d76fe38b RR |
516 | |
517 | /* | |
518 | * SQL_CURSOR_COMMIT_BEHAVIOR | |
519 | * SQL_CURSOR_ROLLBACK_BEHAVIOR | |
520 | */ | |
7beb59f3 WS |
521 | #define SQL_CB_DELETE 0x0000 |
522 | #define SQL_CB_CLOSE 0x0001 | |
523 | #define SQL_CB_PRESERVE 0x0002 | |
d76fe38b RR |
524 | |
525 | /* | |
526 | * SQL_IDENTIFIER_CASE | |
527 | */ | |
7beb59f3 WS |
528 | #define SQL_IC_UPPER 0x0001 |
529 | #define SQL_IC_LOWER 0x0002 | |
530 | #define SQL_IC_SENSITIVE 0x0003 | |
531 | #define SQL_IC_MIXED 0x0004 | |
d76fe38b RR |
532 | |
533 | /* | |
534 | * SQL_TXN_CAPABLE | |
535 | */ | |
7beb59f3 WS |
536 | #define SQL_TC_NONE 0x0000 |
537 | #define SQL_TC_DML 0x0001 | |
538 | #define SQL_TC_ALL 0x0002 | |
539 | #define SQL_TC_DDL_COMMIT 0x0003 | |
540 | #define SQL_TC_DDL_IGNORE 0x0004 | |
d76fe38b RR |
541 | |
542 | /* | |
543 | * SQL_SCROLL_OPTIONS | |
544 | */ | |
7beb59f3 WS |
545 | #define SQL_SO_FORWARD_ONLY 0x00000001L |
546 | #define SQL_SO_KEYSET_DRIVEN 0x00000002L | |
547 | #define SQL_SO_DYNAMIC 0x00000004L | |
548 | #define SQL_SO_MIXED 0x00000008L | |
549 | #define SQL_SO_STATIC 0x00000010L | |
d76fe38b RR |
550 | |
551 | /* | |
552 | * SQL_SCROLL_CONCURRENCY | |
553 | */ | |
7beb59f3 WS |
554 | #define SQL_SCCO_READ_ONLY 0x00000001L |
555 | #define SQL_SCCO_LOCK 0x00000002L | |
556 | #define SQL_SCCO_OPT_ROWVER 0x00000004L | |
557 | #define SQL_SCCO_OPT_VALUES 0x00000008L | |
d76fe38b RR |
558 | |
559 | /* | |
560 | * SQL_FETCH_DIRECTION | |
561 | */ | |
7beb59f3 WS |
562 | #define SQL_FD_FETCH_NEXT 0x00000001L |
563 | #define SQL_FD_FETCH_FIRST 0x00000002L | |
564 | #define SQL_FD_FETCH_LAST 0x00000004L | |
565 | #define SQL_FD_FETCH_PRIOR 0x00000008L | |
566 | #define SQL_FD_FETCH_ABSOLUTE 0x00000010L | |
567 | #define SQL_FD_FETCH_RELATIVE 0x00000020L | |
568 | #define SQL_FD_FETCH_RESUME 0x00000040L | |
569 | #define SQL_FD_FETCH_BOOKMARK 0x00000080L | |
d76fe38b RR |
570 | |
571 | /* | |
572 | * SQL_TXN_ISOLATION_OPTION | |
573 | */ | |
7beb59f3 WS |
574 | #define SQL_TXN_READ_UNCOMMITTED 0x00000001L |
575 | #define SQL_TXN_READ_COMMITTED 0x00000002L | |
576 | #define SQL_TXN_REPEATABLE_READ 0x00000004L | |
577 | #define SQL_TXN_SERIALIZABLE 0x00000008L | |
578 | #define SQL_TXN_VERSIONING 0x00000010L | |
d76fe38b RR |
579 | |
580 | /* | |
581 | * SQL_CORRELATION_NAME | |
582 | */ | |
7beb59f3 WS |
583 | #define SQL_CN_NONE 0x0000 |
584 | #define SQL_CN_DIFFERENT 0x0001 | |
585 | #define SQL_CN_ANY 0x0002 | |
d76fe38b RR |
586 | |
587 | /* | |
588 | * SQL_NON_NULLABLE_COLUMNS | |
589 | */ | |
7beb59f3 WS |
590 | #define SQL_NNC_NULL 0x0000 |
591 | #define SQL_NNC_NON_NULL 0x0001 | |
d76fe38b RR |
592 | |
593 | /* | |
594 | * SQL_NULL_COLLATION | |
595 | */ | |
7beb59f3 WS |
596 | #define SQL_NC_HIGH 0x0000 |
597 | #define SQL_NC_LOW 0x0001 | |
598 | #define SQL_NC_START 0x0002 | |
599 | #define SQL_NC_END 0x0004 | |
d76fe38b RR |
600 | |
601 | /* | |
602 | * SQL_FILE_USAGE | |
603 | */ | |
7beb59f3 WS |
604 | #define SQL_FILE_NOT_SUPPORTED 0x0000 |
605 | #define SQL_FILE_TABLE 0x0001 | |
606 | #define SQL_FILE_QUALIFIER 0x0002 | |
d76fe38b RR |
607 | |
608 | /* | |
609 | * SQL_GETDATA_EXTENSIONS | |
610 | */ | |
7beb59f3 WS |
611 | #define SQL_GD_ANY_COLUMN 0x00000001L |
612 | #define SQL_GD_ANY_ORDER 0x00000002L | |
613 | #define SQL_GD_BLOCK 0x00000004L | |
614 | #define SQL_GD_BOUND 0x00000008L | |
d76fe38b RR |
615 | |
616 | /* | |
617 | * SQL_ALTER_TABLE | |
618 | */ | |
7beb59f3 WS |
619 | #define SQL_AT_ADD_COLUMN 0x00000001L |
620 | #define SQL_AT_DROP_COLUMN 0x00000002L | |
d76fe38b RR |
621 | |
622 | /* | |
623 | * SQL_POSITIONED_STATEMENTS | |
624 | */ | |
7beb59f3 WS |
625 | #define SQL_PS_POSITIONED_DELETE 0x00000001L |
626 | #define SQL_PS_POSITIONED_UPDATE 0x00000002L | |
627 | #define SQL_PS_SELECT_FOR_UPDATE 0x00000004L | |
d76fe38b RR |
628 | |
629 | /* | |
630 | * SQL_GROUP_BY | |
631 | */ | |
7beb59f3 WS |
632 | #define SQL_GB_NOT_SUPPORTED 0x0000 |
633 | #define SQL_GB_GROUP_BY_EQUALS_SELECT 0x0001 | |
634 | #define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002 | |
635 | #define SQL_GB_NO_RELATION 0x0003 | |
d76fe38b RR |
636 | |
637 | /* | |
638 | * SQL_OWNER_USAGE | |
639 | */ | |
7beb59f3 WS |
640 | #define SQL_OU_DML_STATEMENTS 0x00000001L |
641 | #define SQL_OU_PROCEDURE_INVOCATION 0x00000002L | |
642 | #define SQL_OU_TABLE_DEFINITION 0x00000004L | |
643 | #define SQL_OU_INDEX_DEFINITION 0x00000008L | |
644 | #define SQL_OU_PRIVILEGE_DEFINITION 0x00000010L | |
d76fe38b RR |
645 | |
646 | /* | |
647 | * SQL_QUALIFIER_USAGE | |
648 | */ | |
7beb59f3 WS |
649 | #define SQL_QU_DML_STATEMENTS 0x00000001L |
650 | #define SQL_QU_PROCEDURE_INVOCATION 0x00000002L | |
651 | #define SQL_QU_TABLE_DEFINITION 0x00000004L | |
652 | #define SQL_QU_INDEX_DEFINITION 0x00000008L | |
653 | #define SQL_QU_PRIVILEGE_DEFINITION 0x00000010L | |
d76fe38b RR |
654 | |
655 | /* | |
656 | * SQL_SUBQUERIES | |
657 | */ | |
7beb59f3 WS |
658 | #define SQL_SQ_COMPARISON 0x00000001L |
659 | #define SQL_SQ_EXISTS 0x00000002L | |
660 | #define SQL_SQ_IN 0x00000004L | |
661 | #define SQL_SQ_QUANTIFIED 0x00000008L | |
662 | #define SQL_SQ_CORRELATED_SUBQUERIES 0x00000010L | |
d76fe38b RR |
663 | |
664 | /* | |
665 | * SQL_UNION | |
666 | */ | |
7beb59f3 WS |
667 | #define SQL_U_UNION 0x00000001L |
668 | #define SQL_U_UNION_ALL 0x00000002L | |
d76fe38b RR |
669 | |
670 | /* | |
671 | * SQL_BOOKMARK_PERSISTENCE | |
672 | */ | |
7beb59f3 WS |
673 | #define SQL_BP_CLOSE 0x00000001L |
674 | #define SQL_BP_DELETE 0x00000002L | |
675 | #define SQL_BP_DROP 0x00000004L | |
676 | #define SQL_BP_TRANSACTION 0x00000008L | |
677 | #define SQL_BP_UPDATE 0x00000010L | |
678 | #define SQL_BP_OTHER_HSTMT 0x00000020L | |
679 | #define SQL_BP_SCROLL 0x00000040L | |
d76fe38b RR |
680 | |
681 | /* | |
682 | * SQL_STATIC_SENSITIVITY | |
683 | */ | |
7beb59f3 WS |
684 | #define SQL_SS_ADDITIONS 0x00000001L |
685 | #define SQL_SS_DELETIONS 0x00000002L | |
686 | #define SQL_SS_UPDATES 0x00000004L | |
d76fe38b RR |
687 | |
688 | /* | |
689 | * SQL_LOCK_TYPES | |
690 | */ | |
7beb59f3 WS |
691 | #define SQL_LCK_NO_CHANGE 0x00000001L |
692 | #define SQL_LCK_EXCLUSIVE 0x00000002L | |
693 | #define SQL_LCK_UNLOCK 0x00000004L | |
d76fe38b RR |
694 | |
695 | /* | |
696 | * SQL_POS_OPERATIONS | |
697 | */ | |
7beb59f3 WS |
698 | #define SQL_POS_POSITION 0x00000001L |
699 | #define SQL_POS_REFRESH 0x00000002L | |
700 | #define SQL_POS_UPDATE 0x00000004L | |
701 | #define SQL_POS_DELETE 0x00000008L | |
702 | #define SQL_POS_ADD 0x00000010L | |
d76fe38b RR |
703 | |
704 | /* | |
705 | * SQL_QUALIFIER_LOCATION | |
706 | */ | |
7beb59f3 WS |
707 | #define SQL_QL_START 0x0001L |
708 | #define SQL_QL_END 0x0002L | |
d76fe38b RR |
709 | |
710 | /* | |
711 | * SQL_OJ_CAPABILITIES | |
712 | */ | |
7beb59f3 WS |
713 | #define SQL_OJ_LEFT 0x00000001L |
714 | #define SQL_OJ_RIGHT 0x00000002L | |
715 | #define SQL_OJ_FULL 0x00000004L | |
716 | #define SQL_OJ_NESTED 0x00000008L | |
717 | #define SQL_OJ_NOT_ORDERED 0x00000010L | |
718 | #define SQL_OJ_INNER 0x00000020L | |
719 | #define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L | |
d76fe38b RR |
720 | |
721 | /* | |
722 | * SQLGetStmtOption/SQLSetStmtOption | |
723 | */ | |
7beb59f3 WS |
724 | #define SQL_QUERY_TIMEOUT 0 |
725 | #define SQL_MAX_ROWS 1 | |
726 | #define SQL_NOSCAN 2 | |
727 | #define SQL_MAX_LENGTH 3 | |
728 | #define SQL_ASYNC_ENABLE 4 | |
729 | #define SQL_BIND_TYPE 5 | |
730 | #define SQL_CURSOR_TYPE 6 | |
731 | #define SQL_CONCURRENCY 7 | |
732 | #define SQL_KEYSET_SIZE 8 | |
733 | #define SQL_ROWSET_SIZE 9 | |
734 | #define SQL_SIMULATE_CURSOR 10 | |
735 | #define SQL_RETRIEVE_DATA 11 | |
736 | #define SQL_USE_BOOKMARKS 12 | |
737 | #define SQL_GET_BOOKMARK 13 | |
738 | #define SQL_ROW_NUMBER 14 | |
d76fe38b | 739 | |
7beb59f3 WS |
740 | #define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT |
741 | #define SQL_STMT_OPT_MAX SQL_ROW_NUMBER | |
d76fe38b RR |
742 | |
743 | ||
744 | /* | |
745 | * SQL_QUERY_TIMEOUT | |
746 | */ | |
7beb59f3 | 747 | #define SQL_QUERY_TIMEOUT_DEFAULT 0UL |
d76fe38b RR |
748 | |
749 | /* | |
750 | * SQL_MAX_ROWS | |
751 | */ | |
7beb59f3 | 752 | #define SQL_MAX_ROWS_DEFAULT 0UL |
d76fe38b RR |
753 | |
754 | /* | |
755 | * SQL_NOSCAN | |
756 | */ | |
7beb59f3 WS |
757 | #define SQL_NOSCAN_OFF 0UL /* 1.0 FALSE */ |
758 | #define SQL_NOSCAN_ON 1UL /* 1.0 TRUE */ | |
759 | #define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF | |
d76fe38b RR |
760 | |
761 | /* | |
762 | * SQL_MAX_LENGTH | |
763 | */ | |
7beb59f3 | 764 | #define SQL_MAX_LENGTH_DEFAULT 0UL |
d76fe38b RR |
765 | |
766 | /* | |
767 | * SQL_ASYNC_ENABLE | |
768 | */ | |
7beb59f3 WS |
769 | #define SQL_ASYNC_ENABLE_OFF 0UL |
770 | #define SQL_ASYNC_ENABLE_ON 1UL | |
771 | #define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF | |
d76fe38b RR |
772 | |
773 | /* | |
774 | * SQL_BIND_TYPE | |
775 | */ | |
7beb59f3 WS |
776 | #define SQL_BIND_BY_COLUMN 0UL |
777 | #define SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN | |
d76fe38b RR |
778 | |
779 | /* | |
780 | * SQL_CONCURRENCY | |
781 | */ | |
7beb59f3 WS |
782 | #define SQL_CONCUR_READ_ONLY 1 |
783 | #define SQL_CONCUR_LOCK 2 | |
784 | #define SQL_CONCUR_ROWVER 3 | |
785 | #define SQL_CONCUR_VALUES 4 | |
786 | #define SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY | |
d76fe38b RR |
787 | |
788 | /* | |
789 | * SQL_CURSOR_TYPE | |
790 | */ | |
7beb59f3 WS |
791 | #define SQL_CURSOR_FORWARD_ONLY 0UL |
792 | #define SQL_CURSOR_KEYSET_DRIVEN 1UL | |
793 | #define SQL_CURSOR_DYNAMIC 2UL | |
794 | #define SQL_CURSOR_STATIC 3UL | |
795 | #define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY | |
d76fe38b RR |
796 | |
797 | /* | |
798 | * SQL_ROWSET_SIZE | |
799 | */ | |
7beb59f3 | 800 | #define SQL_ROWSET_SIZE_DEFAULT 1UL |
d76fe38b RR |
801 | |
802 | /* | |
803 | * SQL_KEYSET_SIZE | |
804 | */ | |
7beb59f3 | 805 | #define SQL_KEYSET_SIZE_DEFAULT 0UL |
d76fe38b RR |
806 | |
807 | /* | |
808 | * SQL_SIMULATE_CURSOR | |
809 | */ | |
7beb59f3 WS |
810 | #define SQL_SC_NON_UNIQUE 0UL |
811 | #define SQL_SC_TRY_UNIQUE 1UL | |
812 | #define SQL_SC_UNIQUE 2UL | |
d76fe38b RR |
813 | |
814 | /* | |
815 | * SQL_RETRIEVE_DATA | |
816 | */ | |
7beb59f3 WS |
817 | #define SQL_RD_OFF 0UL |
818 | #define SQL_RD_ON 1UL | |
819 | #define SQL_RD_DEFAULT SQL_RD_ON | |
d76fe38b RR |
820 | |
821 | /* | |
822 | * SQL_USE_BOOKMARKS | |
823 | */ | |
7beb59f3 WS |
824 | #define SQL_UB_OFF 0UL |
825 | #define SQL_UB_ON 1UL | |
826 | #define SQL_UB_DEFAULT SQL_UB_OFF | |
d76fe38b RR |
827 | |
828 | /* | |
829 | * SQLSetConnectOption/SQLGetConnectOption | |
830 | */ | |
7beb59f3 WS |
831 | #define SQL_ACCESS_MODE 101 |
832 | #define SQL_AUTOCOMMIT 102 | |
833 | #define SQL_LOGIN_TIMEOUT 103 | |
834 | #define SQL_OPT_TRACE 104 | |
835 | #define SQL_OPT_TRACEFILE 105 | |
836 | #define SQL_TRANSLATE_DLL 106 | |
837 | #define SQL_TRANSLATE_OPTION 107 | |
838 | #define SQL_TXN_ISOLATION 108 | |
839 | #define SQL_CURRENT_QUALIFIER 109 | |
840 | #define SQL_ODBC_CURSORS 110 | |
841 | #define SQL_QUIET_MODE 111 | |
842 | #define SQL_PACKET_SIZE 112 | |
d76fe38b | 843 | |
7beb59f3 WS |
844 | #define SQL_CONN_OPT_MIN SQL_ACCESS_MODE |
845 | #define SQL_CONN_OPT_MAX SQL_PACKET_SIZE | |
846 | #define SQL_CONNECT_OPT_DRVR_START 1000 | |
d76fe38b RR |
847 | |
848 | ||
849 | /* | |
850 | * SQL_ACCESS_MODE | |
851 | */ | |
7beb59f3 WS |
852 | #define SQL_MODE_READ_WRITE 0UL |
853 | #define SQL_MODE_READ_ONLY 1UL | |
854 | #define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE | |
d76fe38b RR |
855 | |
856 | /* | |
857 | * SQL_AUTOCOMMIT | |
858 | */ | |
7beb59f3 WS |
859 | #define SQL_AUTOCOMMIT_OFF 0UL |
860 | #define SQL_AUTOCOMMIT_ON 1UL | |
861 | #define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON | |
d76fe38b RR |
862 | |
863 | /* | |
864 | * SQL_LOGIN_TIMEOUT | |
865 | */ | |
7beb59f3 | 866 | #define SQL_LOGIN_TIMEOUT_DEFAULT 15UL |
d76fe38b RR |
867 | |
868 | /* | |
869 | * SQL_OPT_TRACE | |
870 | */ | |
7beb59f3 WS |
871 | #define SQL_OPT_TRACE_OFF 0UL |
872 | #define SQL_OPT_TRACE_ON 1UL | |
873 | #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF | |
874 | #define SQL_OPT_TRACE_FILE_DEFAULT "odbc.log" | |
d76fe38b RR |
875 | |
876 | /* | |
877 | * SQL_ODBC_CURSORS | |
878 | */ | |
7beb59f3 WS |
879 | #define SQL_CUR_USE_IF_NEEDED 0UL |
880 | #define SQL_CUR_USE_ODBC 1UL | |
881 | #define SQL_CUR_USE_DRIVER 2UL | |
882 | #define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER | |
d76fe38b RR |
883 | |
884 | /* | |
885 | * SQLSpecialColumns - Column types and scopes | |
886 | */ | |
7beb59f3 WS |
887 | #define SQL_BEST_ROWID 1 |
888 | #define SQL_ROWVER 2 | |
d76fe38b | 889 | |
7beb59f3 WS |
890 | #define SQL_SCOPE_CURROW 0 |
891 | #define SQL_SCOPE_TRANSACTION 1 | |
892 | #define SQL_SCOPE_SESSION 2 | |
d76fe38b RR |
893 | |
894 | /* | |
895 | * SQLSetPos | |
896 | */ | |
7beb59f3 | 897 | #define SQL_ENTIRE_ROWSET 0 |
d76fe38b RR |
898 | |
899 | /* | |
900 | * SQLSetPos | |
901 | */ | |
7beb59f3 WS |
902 | #define SQL_POSITION 0 |
903 | #define SQL_REFRESH 1 | |
904 | #define SQL_UPDATE 2 | |
905 | #define SQL_DELETE 3 | |
906 | #define SQL_ADD 4 | |
d76fe38b RR |
907 | |
908 | /* | |
909 | * SQLSetPos | |
910 | */ | |
7beb59f3 WS |
911 | #define SQL_LOCK_NO_CHANGE 0 |
912 | #define SQL_LOCK_EXCLUSIVE 1 | |
913 | #define SQL_LOCK_UNLOCK 2 | |
d76fe38b RR |
914 | |
915 | /* | |
916 | * SQLSetPos | |
917 | */ | |
7beb59f3 | 918 | #define SQL_POSITION_TO(hstmt,irow) \ |
d76fe38b RR |
919 | SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE) |
920 | #define SQL_LOCK_RECORD(hstmt,irow,fLock) \ | |
921 | SQLSetPos(hstmt,irow,SQL_POSITION,fLock) | |
922 | #define SQL_REFRESH_RECORD(hstmt,irow,fLock) \ | |
923 | SQLSetPos(hstmt,irow,SQL_REFRESH,fLock) | |
924 | #define SQL_UPDATE_RECORD(hstmt,irow) \ | |
925 | SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE) | |
926 | #define SQL_DELETE_RECORD(hstmt,irow) \ | |
927 | SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE) | |
928 | #define SQL_ADD_RECORD(hstmt,irow) \ | |
929 | SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE) | |
930 | ||
931 | /* | |
932 | * All the ODBC keywords | |
933 | */ | |
934 | #define SQL_ODBC_KEYWORDS \ | |
935 | "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\ | |
936 | "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\ | |
937 | "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\ | |
938 | "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\ | |
939 | "COBOL,COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\ | |
940 | "CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\ | |
941 | "CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\ | |
942 | "DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\ | |
943 | "DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\ | |
944 | "DISTINCT,DOMAIN,DOUBLE,DROP,"\ | |
945 | "ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\ | |
946 | "EXISTS,EXTERNAL,EXTRACT,"\ | |
947 | "FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\ | |
948 | "GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\ | |
949 | "IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\ | |
950 | "INPUT,INSENSITIVE,INSERT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\ | |
951 | "JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\ | |
952 | "MATCH,MAX,MIN,MINUTE,MODULE,MONTH,MUMPS,"\ | |
953 | "NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\ | |
954 | "OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\ | |
955 | "PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\ | |
956 | "PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\ | |
957 | "REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS,"\ | |
958 | "SCHEMA,SCROLL,SECOND,SECTION,SELECT,SEQUENCE,SESSION,SESSION_USER,SET,SIZE,"\ | |
959 | "SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\ | |
960 | "SUBSTRING,SUM,SYSTEM_USER,"\ | |
961 | "TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\ | |
962 | "TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\ | |
963 | "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\ | |
964 | "VALUE,,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,YEAR" | |
965 | ||
966 | /* | |
967 | * ---------------------------------------------------------------------- | |
968 | * Level 2 Functions | |
969 | * ---------------------------------------------------------------------- | |
970 | */ | |
971 | ||
972 | /* | |
973 | * SQLExtendedFetch - fFetchType | |
974 | */ | |
7beb59f3 WS |
975 | #define SQL_FETCH_NEXT 1 |
976 | #define SQL_FETCH_FIRST 2 | |
977 | #define SQL_FETCH_LAST 3 | |
978 | #define SQL_FETCH_PRIOR 4 | |
979 | #define SQL_FETCH_ABSOLUTE 5 | |
980 | #define SQL_FETCH_RELATIVE 6 | |
981 | #define SQL_FETCH_BOOKMARK 8 | |
d76fe38b RR |
982 | |
983 | /* | |
984 | * SQLExtendedFetch - rgfRowStatus | |
985 | */ | |
7beb59f3 WS |
986 | #define SQL_ROW_SUCCESS 0 |
987 | #define SQL_ROW_DELETED 1 | |
988 | #define SQL_ROW_UPDATED 2 | |
989 | #define SQL_ROW_NOROW 3 | |
990 | #define SQL_ROW_ADDED 4 | |
991 | #define SQL_ROW_ERROR 5 | |
d76fe38b RR |
992 | |
993 | /* | |
994 | * SQLForeignKeys - UPDATE_RULE/DELETE_RULE | |
995 | */ | |
7beb59f3 WS |
996 | #define SQL_CASCADE 0 |
997 | #define SQL_RESTRICT 1 | |
998 | #define SQL_SET_NULL 2 | |
d76fe38b RR |
999 | |
1000 | /* | |
1001 | * SQLBindParameter - fParamType | |
1002 | * SQLProcedureColumns - COLUMN_TYPE | |
1003 | */ | |
7beb59f3 WS |
1004 | #define SQL_PARAM_TYPE_UNKNOWN 0 |
1005 | #define SQL_PARAM_INPUT 1 | |
1006 | #define SQL_PARAM_INPUT_OUTPUT 2 | |
1007 | #define SQL_RESULT_COL 3 | |
1008 | #define SQL_PARAM_OUTPUT 4 | |
1009 | #define SQL_RETURN_VALUE 5 | |
d76fe38b RR |
1010 | |
1011 | /* | |
1012 | * SQLSetParam to SQLBindParameter conversion | |
1013 | */ | |
7beb59f3 WS |
1014 | #define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT |
1015 | #define SQL_SETPARAM_VALUE_MAX (-1L) | |
d76fe38b RR |
1016 | |
1017 | /* | |
1018 | * SQLStatistics - fUnique | |
1019 | */ | |
7beb59f3 WS |
1020 | #define SQL_INDEX_UNIQUE 0 |
1021 | #define SQL_INDEX_ALL 1 | |
d76fe38b RR |
1022 | |
1023 | /* | |
1024 | * SQLStatistics - fAccuracy | |
1025 | */ | |
7beb59f3 WS |
1026 | #define SQL_QUICK 0 |
1027 | #define SQL_ENSURE 1 | |
d76fe38b RR |
1028 | |
1029 | /* | |
1030 | * SQLStatistics - TYPE | |
1031 | */ | |
7beb59f3 WS |
1032 | #define SQL_TABLE_STAT 0 |
1033 | #define SQL_INDEX_CLUSTERED 1 | |
1034 | #define SQL_INDEX_HASHED 2 | |
1035 | #define SQL_INDEX_OTHER 3 | |
d76fe38b RR |
1036 | |
1037 | /* | |
1038 | * SQLProcedures - PROCEDURE_TYPE | |
1039 | */ | |
7beb59f3 WS |
1040 | #define SQL_PT_UNKNOWN 0 |
1041 | #define SQL_PT_PROCEDURE 1 | |
1042 | #define SQL_PT_FUNCTION 2 | |
d76fe38b RR |
1043 | |
1044 | /* | |
1045 | * SQLSpecialColumns - PSEUDO_COLUMN | |
1046 | */ | |
7beb59f3 WS |
1047 | #define SQL_PC_UNKNOWN 0 |
1048 | #define SQL_PC_NOT_PSEUDO 1 | |
1049 | #define SQL_PC_PSEUDO 2 | |
d76fe38b RR |
1050 | |
1051 | /* | |
1052 | * Deprecated defines from prior versions of ODBC | |
1053 | */ | |
7beb59f3 WS |
1054 | #define SQL_DATABASE_NAME 16 |
1055 | #define SQL_FD_FETCH_PREV SQL_FD_FETCH_PRIOR | |
1056 | #define SQL_FETCH_PREV SQL_FETCH_PRIOR | |
1057 | #define SQL_CONCUR_TIMESTAMP SQL_CONCUR_ROWVER | |
1058 | #define SQL_SCCO_OPT_TIMESTAMP SQL_SCCO_OPT_ROWVER | |
1059 | #define SQL_CC_DELETE SQL_CB_DELETE | |
1060 | #define SQL_CR_DELETE SQL_CB_DELETE | |
1061 | #define SQL_CC_CLOSE SQL_CB_CLOSE | |
1062 | #define SQL_CR_CLOSE SQL_CB_CLOSE | |
1063 | #define SQL_CC_PRESERVE SQL_CB_PRESERVE | |
1064 | #define SQL_CR_PRESERVE SQL_CB_PRESERVE | |
1065 | #define SQL_FETCH_RESUME 7 | |
1066 | #define SQL_SCROLL_FORWARD_ONLY 0L | |
1067 | #define SQL_SCROLL_KEYSET_DRIVEN (-1L) | |
1068 | #define SQL_SCROLL_DYNAMIC (-2L) | |
1069 | #define SQL_SCROLL_STATIC (-3L) | |
1070 | #define SQL_PC_NON_PSEUDO SQL_PC_NOT_PSEUDO | |
d76fe38b RR |
1071 | |
1072 | #ifdef __cplusplus | |
1073 | extern "C" { | |
1074 | #endif | |
1075 | /* | |
1076 | * Level 1 function prototypes | |
1077 | */ | |
1078 | RETCODE SQL_API SQLColumns (HSTMT hstmt, UCHAR FAR * szTableQualifier, | |
1079 | SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, | |
1080 | UCHAR FAR * szTableName, SWORD cbTableName, UCHAR FAR * szColumnName, | |
1081 | SWORD cbColumnName); | |
7a5214a8 | 1082 | /* glt - Changed HWND to SQLHWND to match MSW header typing */ |
d62e9220 | 1083 | RETCODE SQL_API SQLDriverConnect (HDBC hdbc, SQLHWND hwnd, |
d76fe38b RR |
1084 | UCHAR FAR * szConnStrIn, SWORD cbConnStrIn, UCHAR FAR * szConnStrOut, |
1085 | SWORD cbConnStrOutMax, SWORD FAR * pcbConnStrOut, UWORD fDriverCompletion); | |
1086 | RETCODE SQL_API SQLGetConnectOption (HDBC hdbc, UWORD fOption, PTR pvParam); | |
1087 | RETCODE SQL_API SQLGetData (HSTMT hstmt, UWORD icol, SWORD fCType, | |
1088 | PTR rgbValue, SDWORD cbValueMax, SDWORD FAR * pcbValue); | |
1089 | RETCODE SQL_API SQLGetFunctions (HDBC hdbc, UWORD fFunction, | |
1090 | UWORD FAR * pfExists); | |
1091 | RETCODE SQL_API SQLGetInfo (HDBC hdbc, UWORD fInfoType, PTR rgbInfoValue, | |
1092 | SWORD cbInfoValueMax, SWORD FAR * pcbInfoValue); | |
1093 | RETCODE SQL_API SQLGetStmtOption (HSTMT hstmt, UWORD fOption, PTR pvParam); | |
1094 | RETCODE SQL_API SQLGetTypeInfo (HSTMT hstmt, SWORD fSqlType); | |
1095 | RETCODE SQL_API SQLParamData (HSTMT hstmt, PTR FAR * prgbValue); | |
1096 | RETCODE SQL_API SQLPutData (HSTMT hstmt, PTR rgbValue, SDWORD cbValue); | |
1097 | RETCODE SQL_API SQLSetConnectOption (HDBC hdbc, UWORD fOption, UDWORD vParam); | |
1098 | RETCODE SQL_API SQLSetStmtOption (HSTMT hstmt, UWORD fOption, UDWORD vParam); | |
1099 | RETCODE SQL_API SQLSpecialColumns (HSTMT hstmt, UWORD fColType, | |
1100 | UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, | |
1101 | UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, | |
1102 | SWORD cbTableName, UWORD fScope, UWORD fNullable); | |
1103 | RETCODE SQL_API SQLStatistics (HSTMT hstmt, UCHAR FAR * szTableQualifier, | |
1104 | SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, | |
1105 | UCHAR FAR * szTableName, SWORD cbTableName, UWORD fUnique, UWORD fAccuracy); | |
1106 | RETCODE SQL_API SQLTables (HSTMT hstmt, UCHAR FAR * szTableQualifier, | |
1107 | SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, | |
1108 | UCHAR FAR * szTableName, SWORD cbTableName, UCHAR FAR * szTableType, | |
1109 | SWORD cbTableType); | |
1110 | ||
1111 | /* | |
1112 | * Level 2 function prototypes | |
1113 | */ | |
c67b773e DW |
1114 | RETCODE SQL_API SQLBrowseConnect (HDBC hdbc, |
1115 | UCHAR FAR * szConnStrIn, SWORD cbConnStrIn, UCHAR FAR * szConnStrOut, | |
d76fe38b RR |
1116 | SWORD cbConnStrOutMax, SWORD FAR * pcbConnStrOut); |
1117 | RETCODE SQL_API SQLColumnPrivileges (HSTMT hstmt, | |
1118 | UCHAR FAR * szTableQualifier, SWORD cbTableQualifier, | |
1119 | UCHAR FAR * szTableOwner, SWORD cbTableOwner, UCHAR FAR * szTableName, | |
1120 | SWORD cbTableName, UCHAR FAR * szColumnName, SWORD cbColumnName); | |
1121 | RETCODE SQL_API SQLDataSources (HENV henv, UWORD fDirection, | |
1122 | UCHAR FAR * szDSN, SWORD cbDSNMax, SWORD FAR * pcbDSN, | |
1123 | UCHAR FAR * szDescription, SWORD cbDescriptionMax, | |
1124 | SWORD FAR * pcbDescription); | |
1125 | RETCODE SQL_API SQLDescribeParam (HSTMT hstmt, UWORD ipar, | |
1126 | SWORD FAR * pfSqlType, UDWORD FAR * pcbColDef, SWORD FAR * pibScale, | |
1127 | SWORD FAR * pfNullable); | |
1128 | RETCODE SQL_API SQLExtendedFetch (HSTMT hstmt, UWORD fFetchType, SDWORD irow, | |
1129 | UDWORD FAR * pcrow, UWORD FAR * rgfRowStatus); | |
1130 | RETCODE SQL_API SQLForeignKeys (HSTMT hstmt, UCHAR FAR * szPkTableQualifier, | |
1131 | SWORD cbPkTableQualifier, UCHAR FAR * szPkTableOwner, SWORD cbPkTableOwner, | |
1132 | UCHAR FAR * szPkTableName, SWORD cbPkTableName, | |
1133 | UCHAR FAR * szFkTableQualifier, SWORD cbFkTableQualifier, | |
1134 | UCHAR FAR * szFkTableOwner, SWORD cbFkTableOwner, UCHAR FAR * szFkTableName, | |
1135 | SWORD cbFkTableName); | |
1136 | RETCODE SQL_API SQLMoreResults (HSTMT hstmt); | |
1137 | RETCODE SQL_API SQLNativeSql (HDBC hdbc, UCHAR FAR * szSqlStrIn, | |
1138 | SDWORD cbSqlStrIn, UCHAR FAR * szSqlStr, SDWORD cbSqlStrMax, | |
1139 | SDWORD FAR * pcbSqlStr); | |
1140 | RETCODE SQL_API SQLNumParams (HSTMT hstmt, SWORD FAR * pcpar); | |
1141 | RETCODE SQL_API SQLParamOptions (HSTMT hstmt, UDWORD crow, UDWORD FAR * pirow); | |
1142 | RETCODE SQL_API SQLPrimaryKeys (HSTMT hstmt, UCHAR FAR * szTableQualifier, | |
1143 | SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, | |
1144 | UCHAR FAR * szTableName, SWORD cbTableName); | |
1145 | RETCODE SQL_API SQLProcedureColumns (HSTMT hstmt, UCHAR FAR * szProcQualifier, | |
1146 | SWORD cbProcQualifier, UCHAR FAR * szProcOwner, SWORD cbProcOwner, | |
1147 | UCHAR FAR * szProcName, SWORD cbProcName, UCHAR FAR * szColumnName, | |
1148 | SWORD cbColumnName); | |
1149 | RETCODE SQL_API SQLProcedures (HSTMT hstmt, UCHAR FAR * szProcQualifier, | |
1150 | SWORD cbProcQualifier, UCHAR FAR * szProcOwner, SWORD cbProcOwner, | |
1151 | UCHAR FAR * szProcName, SWORD cbProcName); | |
1152 | RETCODE SQL_API SQLSetPos (HSTMT hstmt, UWORD irow, UWORD fOption, UWORD fLock); | |
1153 | RETCODE SQL_API SQLTablePrivileges (HSTMT hstmt, UCHAR FAR * szTableQualifier, | |
1154 | SWORD cbTableQualifier, UCHAR FAR * szTableOwner, SWORD cbTableOwner, | |
1155 | UCHAR FAR * szTableName, SWORD cbTableName); | |
1156 | ||
1157 | /* | |
1158 | * SDK 2.0 Additional function prototypes | |
1159 | */ | |
1160 | RETCODE SQL_API SQLDrivers (HENV henv, UWORD fDirection, | |
1161 | UCHAR FAR * szDriverDesc, SWORD cbDriverDescMax, SWORD FAR * pcbDriverDesc, | |
1162 | UCHAR FAR * szDriverAttributes, SWORD cbDrvrAttrMax, | |
1163 | SWORD FAR * pcbDrvrAttr); | |
1164 | RETCODE SQL_API SQLBindParameter (HSTMT hstmt, UWORD ipar, SWORD fParamType, | |
1165 | SWORD fCType, SWORD fSqlType, UDWORD cbColDef, SWORD ibScale, PTR rgbValue, | |
1166 | SDWORD cbValueMax, SDWORD FAR * pcbValue); | |
1167 | ||
1168 | /* | |
1169 | * Depreciated - use SQLSetStmtOptions | |
1170 | */ | |
1171 | RETCODE SQL_API SQLSetScrollOptions (HSTMT hstmt, UWORD fConcurrency, | |
1172 | SDWORD crowKeyset, UWORD crowRowset); | |
1173 | ||
1174 | #ifdef __cplusplus | |
1175 | } | |
1176 | #endif | |
1177 | ||
1178 | #endif |