allocator fixes
[csql.git] / include / sqlext.h
blobe24c00a468dd14fc3ed420328225ab96a660f541
3 /*****************************************************
4 * sqlext.h
6 * These should be consistent with the MS version.
8 *****************************************************/
9 #ifndef __SQLEXT_H
10 #define __SQLEXT_H
13 /* BEGIN - unixODBC ONLY (programs like ODBCConfig and DataManager use these) */
15 /* COLUMNS IN SQLTables() RESULT SET */
16 #define SQLTables_TABLE_CATALOG 1
17 #define SQLTables_TABLE_SCHEM 2
18 #define SQLTables_TABLE_NAME 3
19 #define SQLTables_TABLE_TYPE 4
20 #define SQLTables_REMARKS 5
22 /* COLUMNS IN SQLColumns() RESULT SET */
23 #define SQLColumns_TABLE_CAT 1
24 #define SQLColumns_TABLE_SCHEM 2
25 #define SQLColumns_TABLE_NAME 3
26 #define SQLColumns_COLUMN_NAME 4
27 #define SQLColumns_DATA_TYPE 5
28 #define SQLColumns_TYPE_NAME 6
29 #define SQLColumns_COLUMN_SIZE 7
30 #define SQLColumns_BUFFER_LENGTH 8
31 #define SQLColumns_DECIMAL_DIGITS 9
32 #define SQLColumns_NUM_PREC_RADIX 10
33 #define SQLColumns_NULLABLE 11
34 #define SQLColumns_REMARKS 12
35 #define SQLColumns_COLUMN_DEF 13
36 #define SQLColumns_SQL_DATA_TYPE 14
37 #define SQLColumns_SQL_DATETIME_SUB 15
38 #define SQLColumns_CHAR_OCTET_LENGTH 16
39 #define SQLColumns_ORDINAL_POSITION 17
40 #define SQLColumns_IS_NULLABLE 18
42 /* END - unixODBC ONLY */
44 #ifndef __SQL_H
45 #include "sql.h"
46 #endif
48 #ifdef __cplusplus
49 extern "C" { /* Assume C declarations for C++ */
50 #endif
52 /* generally useful constants */
53 #define SQL_SPEC_MAJOR 3 /* Major version of specification */
54 #define SQL_SPEC_MINOR 52 /* Minor version of specification */
55 #define SQL_SPEC_STRING "03.52" /* String constant for version */
57 #define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */
58 #define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */
60 #define SQL_MAX_OPTION_STRING_LENGTH 256
62 /* return code SQL_NO_DATA_FOUND is the same as SQL_NO_DATA */
63 #if (ODBCVER < 0x0300)
64 #define SQL_NO_DATA_FOUND 100
65 #else
66 #define SQL_NO_DATA_FOUND SQL_NO_DATA
67 #endif
69 /* an end handle type */
70 #if (ODBCVER >= 0x0300)
71 #define SQL_HANDLE_SENV 5
72 #endif /* ODBCVER >= 0x0300 */
74 /* env attribute */
75 #if (ODBCVER >= 0x0300)
76 #define SQL_ATTR_ODBC_VERSION 200
77 #define SQL_ATTR_CONNECTION_POOLING 201
78 #define SQL_ATTR_CP_MATCH 202
80 /* unixODBC additions */
81 #define SQL_ATTR_UNIXODBC_SYSPATH 65001
82 #define SQL_ATTR_UNIXODBC_VERSION 65002
83 #define SQL_ATTR_UNIXODBC_ENVATTR 65003
84 #endif /* ODBCVER >= 0x0300 */
86 #if (ODBCVER >= 0x0300)
87 /* values for SQL_ATTR_CONNECTION_POOLING */
88 #define SQL_CP_OFF 0UL
89 #define SQL_CP_ONE_PER_DRIVER 1UL
90 #define SQL_CP_ONE_PER_HENV 2UL
91 #define SQL_CP_DEFAULT SQL_CP_OFF
93 /* values for SQL_ATTR_CP_MATCH */
94 #define SQL_CP_STRICT_MATCH 0UL
95 #define SQL_CP_RELAXED_MATCH 1UL
96 #define SQL_CP_MATCH_DEFAULT SQL_CP_STRICT_MATCH
98 /* values for SQL_ATTR_ODBC_VERSION */
99 #define SQL_OV_ODBC2 2UL
100 #define SQL_OV_ODBC3 3UL
101 #endif /* ODBCVER >= 0x0300 */
103 /* connection attributes */
104 #define SQL_ACCESS_MODE 101
105 #define SQL_AUTOCOMMIT 102
106 #define SQL_LOGIN_TIMEOUT 103
107 #define SQL_OPT_TRACE 104
108 #define SQL_OPT_TRACEFILE 105
109 #define SQL_TRANSLATE_DLL 106
110 #define SQL_TRANSLATE_OPTION 107
111 #define SQL_TXN_ISOLATION 108
112 #define SQL_CURRENT_QUALIFIER 109
113 #define SQL_ODBC_CURSORS 110
114 #define SQL_QUIET_MODE 111
115 #define SQL_PACKET_SIZE 112
117 /* connection attributes with new names */
118 #if (ODBCVER >= 0x0300)
119 #define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
120 #define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
121 #define SQL_ATTR_CONNECTION_TIMEOUT 113
122 #define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER
123 #define SQL_ATTR_DISCONNECT_BEHAVIOR 114
124 #define SQL_ATTR_ENLIST_IN_DTC 1207
125 #define SQL_ATTR_ENLIST_IN_XA 1208
126 #define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT
127 #define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS
128 #define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE
129 #define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE
130 #define SQL_ATTR_TRACE SQL_OPT_TRACE
131 #define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE
132 #define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL
133 #define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION
134 #define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
135 #endif /* ODBCVER >= 0x0300 */
137 #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */
139 #define SQL_ATTR_DRIVER_THREADING 1028 /* Driver threading level */
141 #if (ODBCVER >= 0x0351)
142 /* ODBC Driver Manager sets this connection attribute to a unicode driver
143 (which supports SQLConnectW) when the application is an ANSI application
144 (which calls SQLConnect, SQLDriverConnect, or SQLBrowseConnect).
145 This is SetConnectAttr only and application does not set this attribute
146 This attribute was introduced because some unicode driver's some APIs may
147 need to behave differently on ANSI or Unicode applications. A unicode
148 driver, which has same behavior for both ANSI or Unicode applications,
149 should return SQL_ERROR when the driver manager sets this connection
150 attribute. When a unicode driver returns SQL_SUCCESS on this attribute,
151 the driver manager treates ANSI and Unicode connections differently in
152 connection pooling.
154 #define SQL_ATTR_ANSI_APP 115
155 #endif
157 /* SQL_CONNECT_OPT_DRVR_START is not meaningful for 3.0 driver */
158 #if (ODBCVER < 0x0300)
159 #define SQL_CONNECT_OPT_DRVR_START 1000
160 #endif /* ODBCVER < 0x0300 */
162 #if (ODBCVER < 0x0300)
163 #define SQL_CONN_OPT_MAX SQL_PACKET_SIZE
164 #define SQL_CONN_OPT_MIN SQL_ACCESS_MODE
165 #endif /* ODBCVER < 0x0300 */
167 /* SQL_ACCESS_MODE options */
168 #define SQL_MODE_READ_WRITE 0UL
169 #define SQL_MODE_READ_ONLY 1UL
170 #define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE
172 /* SQL_AUTOCOMMIT options */
173 #define SQL_AUTOCOMMIT_OFF 0UL
174 #define SQL_AUTOCOMMIT_ON 1UL
175 #define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON
177 /* SQL_LOGIN_TIMEOUT options */
178 #define SQL_LOGIN_TIMEOUT_DEFAULT 15UL
180 /* SQL_OPT_TRACE options */
181 #define SQL_OPT_TRACE_OFF 0UL
182 #define SQL_OPT_TRACE_ON 1UL
183 #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF
184 #define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG"
186 /* SQL_ODBC_CURSORS options */
187 #define SQL_CUR_USE_IF_NEEDED 0UL
188 #define SQL_CUR_USE_ODBC 1UL
189 #define SQL_CUR_USE_DRIVER 2UL
190 #define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER
192 #if (ODBCVER >= 0x0300)
193 /* values for SQL_ATTR_DISCONNECT_BEHAVIOR */
194 #define SQL_DB_RETURN_TO_POOL 0UL
195 #define SQL_DB_DISCONNECT 1UL
196 #define SQL_DB_DEFAULT SQL_DB_RETURN_TO_POOL
198 /* values for SQL_ATTR_ENLIST_IN_DTC */
199 #define SQL_DTC_DONE 0L
200 #endif /* ODBCVER >= 0x0300 */
202 /* values for SQL_ATTR_CONNECTION_DEAD */
203 #define SQL_CD_TRUE 1L /* Connection is closed/dead */
204 #define SQL_CD_FALSE 0L /* Connection is open/available */
206 /* values for SQL_ATTR_ANSI_APP */
207 #if (ODBCVER >= 0x0351)
208 #define SQL_AA_TRUE 1L /* the application is an ANSI app */
209 #define SQL_AA_FALSE 0L /* the application is a Unicode app */
210 #endif
212 /* statement attributes */
213 #define SQL_QUERY_TIMEOUT 0
214 #define SQL_MAX_ROWS 1
215 #define SQL_NOSCAN 2
216 #define SQL_MAX_LENGTH 3
217 #define SQL_ASYNC_ENABLE 4 /* same as SQL_ATTR_ASYNC_ENABLE */
218 #define SQL_BIND_TYPE 5
219 #define SQL_CURSOR_TYPE 6
220 #define SQL_CONCURRENCY 7
221 #define SQL_KEYSET_SIZE 8
222 #define SQL_ROWSET_SIZE 9
223 #define SQL_SIMULATE_CURSOR 10
224 #define SQL_RETRIEVE_DATA 11
225 #define SQL_USE_BOOKMARKS 12
226 #define SQL_GET_BOOKMARK 13 /* GetStmtOption Only */
227 #define SQL_ROW_NUMBER 14 /* GetStmtOption Only */
229 /* statement attributes for ODBC 3.0 */
230 #if (ODBCVER >= 0x0300)
231 #define SQL_ATTR_ASYNC_ENABLE 4
232 #define SQL_ATTR_CONCURRENCY SQL_CONCURRENCY
233 #define SQL_ATTR_CURSOR_TYPE SQL_CURSOR_TYPE
234 #define SQL_ATTR_ENABLE_AUTO_IPD 15
235 #define SQL_ATTR_FETCH_BOOKMARK_PTR 16
236 #define SQL_ATTR_KEYSET_SIZE SQL_KEYSET_SIZE
237 #define SQL_ATTR_MAX_LENGTH SQL_MAX_LENGTH
238 #define SQL_ATTR_MAX_ROWS SQL_MAX_ROWS
239 #define SQL_ATTR_NOSCAN SQL_NOSCAN
240 #define SQL_ATTR_PARAM_BIND_OFFSET_PTR 17
241 #define SQL_ATTR_PARAM_BIND_TYPE 18
242 #define SQL_ATTR_PARAM_OPERATION_PTR 19
243 #define SQL_ATTR_PARAM_STATUS_PTR 20
244 #define SQL_ATTR_PARAMS_PROCESSED_PTR 21
245 #define SQL_ATTR_PARAMSET_SIZE 22
246 #define SQL_ATTR_QUERY_TIMEOUT SQL_QUERY_TIMEOUT
247 #define SQL_ATTR_RETRIEVE_DATA SQL_RETRIEVE_DATA
248 #define SQL_ATTR_ROW_BIND_OFFSET_PTR 23
249 #define SQL_ATTR_ROW_BIND_TYPE SQL_BIND_TYPE
250 #define SQL_ATTR_ROW_NUMBER SQL_ROW_NUMBER /*GetStmtAttr*/
251 #define SQL_ATTR_ROW_OPERATION_PTR 24
252 #define SQL_ATTR_ROW_STATUS_PTR 25
253 #define SQL_ATTR_ROWS_FETCHED_PTR 26
254 #define SQL_ATTR_ROW_ARRAY_SIZE 27
255 #define SQL_ATTR_SIMULATE_CURSOR SQL_SIMULATE_CURSOR
256 #define SQL_ATTR_USE_BOOKMARKS SQL_USE_BOOKMARKS
258 #endif /* ODBCVER >= 0x0300 */
260 #if (ODBCVER < 0x0300)
261 #define SQL_STMT_OPT_MAX SQL_ROW_NUMBER
262 #define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT
263 #endif /* ODBCVER < 0x0300 */
265 /* New defines for SEARCHABLE column in SQLGetTypeInfo */
267 #if (ODBCVER >= 0x0300)
268 #define SQL_COL_PRED_CHAR SQL_LIKE_ONLY
269 #define SQL_COL_PRED_BASIC SQL_ALL_EXCEPT_LIKE
270 #endif /* ODBCVER >= 0x0300 */
274 /* whether an attribute is a pointer or not */
275 #if (ODBCVER >= 0x0300)
276 #define SQL_IS_POINTER (-4)
277 #define SQL_IS_UINTEGER (-5)
278 #define SQL_IS_INTEGER (-6)
279 #define SQL_IS_USMALLINT (-7)
280 #define SQL_IS_SMALLINT (-8)
281 #endif /* ODBCVER >= 0x0300 */
283 /* the value of SQL_ATTR_PARAM_BIND_TYPE */
284 #if (ODBCVER >= 0x0300)
285 #define SQL_PARAM_BIND_BY_COLUMN 0UL
286 #define SQL_PARAM_BIND_TYPE_DEFAULT SQL_PARAM_BIND_BY_COLUMN
287 #endif /* ODBCVER >= 0x0300 */
289 /* SQL_QUERY_TIMEOUT options */
290 #define SQL_QUERY_TIMEOUT_DEFAULT 0UL
292 /* SQL_MAX_ROWS options */
293 #define SQL_MAX_ROWS_DEFAULT 0UL
295 /* SQL_NOSCAN options */
296 #define SQL_NOSCAN_OFF 0UL /* 1.0 FALSE */
297 #define SQL_NOSCAN_ON 1UL /* 1.0 TRUE */
298 #define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF
300 /* SQL_MAX_LENGTH options */
301 #define SQL_MAX_LENGTH_DEFAULT 0UL
303 /* values for SQL_ATTR_ASYNC_ENABLE */
304 #define SQL_ASYNC_ENABLE_OFF 0UL
305 #define SQL_ASYNC_ENABLE_ON 1UL
306 #define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF
308 /* SQL_BIND_TYPE options */
309 #define SQL_BIND_BY_COLUMN 0UL
310 #define SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN /* Default value */
312 /* SQL_CONCURRENCY options */
313 #define SQL_CONCUR_READ_ONLY 1
314 #define SQL_CONCUR_LOCK 2
315 #define SQL_CONCUR_ROWVER 3
316 #define SQL_CONCUR_VALUES 4
317 #define SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY /* Default value */
319 /* SQL_CURSOR_TYPE options */
320 #define SQL_CURSOR_FORWARD_ONLY 0UL
321 #define SQL_CURSOR_KEYSET_DRIVEN 1UL
322 #define SQL_CURSOR_DYNAMIC 2UL
323 #define SQL_CURSOR_STATIC 3UL
324 #define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY /* Default value */
326 /* SQL_ROWSET_SIZE options */
327 #define SQL_ROWSET_SIZE_DEFAULT 1UL
329 /* SQL_KEYSET_SIZE options */
330 #define SQL_KEYSET_SIZE_DEFAULT 0UL
332 /* SQL_SIMULATE_CURSOR options */
333 #define SQL_SC_NON_UNIQUE 0UL
334 #define SQL_SC_TRY_UNIQUE 1UL
335 #define SQL_SC_UNIQUE 2UL
337 /* SQL_RETRIEVE_DATA options */
338 #define SQL_RD_OFF 0UL
339 #define SQL_RD_ON 1UL
340 #define SQL_RD_DEFAULT SQL_RD_ON
342 /* SQL_USE_BOOKMARKS options */
343 #define SQL_UB_OFF 0UL
344 #define SQL_UB_ON 01UL
345 #define SQL_UB_DEFAULT SQL_UB_OFF
347 /* New values for SQL_USE_BOOKMARKS attribute */
348 #if (ODBCVER >= 0x0300)
349 #define SQL_UB_FIXED SQL_UB_ON
350 #define SQL_UB_VARIABLE 2UL
351 #endif /* ODBCVER >= 0x0300 */
353 /* extended descriptor field */
354 #if (ODBCVER >= 0x0300)
355 #define SQL_DESC_ARRAY_SIZE 20
356 #define SQL_DESC_ARRAY_STATUS_PTR 21
357 #define SQL_DESC_AUTO_UNIQUE_VALUE SQL_COLUMN_AUTO_INCREMENT
358 #define SQL_DESC_BASE_COLUMN_NAME 22
359 #define SQL_DESC_BASE_TABLE_NAME 23
360 #define SQL_DESC_BIND_OFFSET_PTR 24
361 #define SQL_DESC_BIND_TYPE 25
362 #define SQL_DESC_CASE_SENSITIVE SQL_COLUMN_CASE_SENSITIVE
363 #define SQL_DESC_CATALOG_NAME SQL_COLUMN_QUALIFIER_NAME
364 #define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE
365 #define SQL_DESC_DATETIME_INTERVAL_PRECISION 26
366 #define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE
367 #define SQL_DESC_FIXED_PREC_SCALE SQL_COLUMN_MONEY
368 #define SQL_DESC_LABEL SQL_COLUMN_LABEL
369 #define SQL_DESC_LITERAL_PREFIX 27
370 #define SQL_DESC_LITERAL_SUFFIX 28
371 #define SQL_DESC_LOCAL_TYPE_NAME 29
372 #define SQL_DESC_MAXIMUM_SCALE 30
373 #define SQL_DESC_MINIMUM_SCALE 31
374 #define SQL_DESC_NUM_PREC_RADIX 32
375 #define SQL_DESC_PARAMETER_TYPE 33
376 #define SQL_DESC_ROWS_PROCESSED_PTR 34
377 #if (ODBCVER >= 0x0350)
378 #define SQL_DESC_ROWVER 35
379 #endif /* ODBCVER >= 0x0350 */
380 #define SQL_DESC_SCHEMA_NAME SQL_COLUMN_OWNER_NAME
381 #define SQL_DESC_SEARCHABLE SQL_COLUMN_SEARCHABLE
382 #define SQL_DESC_TYPE_NAME SQL_COLUMN_TYPE_NAME
383 #define SQL_DESC_TABLE_NAME SQL_COLUMN_TABLE_NAME
384 #define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED
385 #define SQL_DESC_UPDATABLE SQL_COLUMN_UPDATABLE
386 #endif /* ODBCVER >= 0x0300 */
389 /* defines for diagnostics fields */
390 #if (ODBCVER >= 0x0300)
391 #define SQL_DIAG_CURSOR_ROW_COUNT (-1249)
392 #define SQL_DIAG_ROW_NUMBER (-1248)
393 #define SQL_DIAG_COLUMN_NUMBER (-1247)
394 #endif /* ODBCVER >= 0x0300 */
396 /* SQL extended datatypes */
397 #define SQL_DATE 9
398 #if (ODBCVER >= 0x0300)
399 #define SQL_INTERVAL 10
400 #endif /* ODBCVER >= 0x0300 */
401 #define SQL_TIME 10
402 #define SQL_TIMESTAMP 11
403 #define SQL_LONGVARCHAR (-1)
404 #define SQL_BINARY (-2)
405 #define SQL_VARBINARY (-3)
406 #define SQL_LONGVARBINARY (-4)
407 #define SQL_BIGINT (-5)
408 #define SQL_TINYINT (-6)
409 #define SQL_BIT (-7)
410 #if (ODBCVER >= 0x0350)
411 #define SQL_GUID (-11)
412 #endif /* ODBCVER >= 0x0350 */
414 #if (ODBCVER >= 0x0300)
415 /* interval code */
416 #define SQL_CODE_YEAR 1
417 #define SQL_CODE_MONTH 2
418 #define SQL_CODE_DAY 3
419 #define SQL_CODE_HOUR 4
420 #define SQL_CODE_MINUTE 5
421 #define SQL_CODE_SECOND 6
422 #define SQL_CODE_YEAR_TO_MONTH 7
423 #define SQL_CODE_DAY_TO_HOUR 8
424 #define SQL_CODE_DAY_TO_MINUTE 9
425 #define SQL_CODE_DAY_TO_SECOND 10
426 #define SQL_CODE_HOUR_TO_MINUTE 11
427 #define SQL_CODE_HOUR_TO_SECOND 12
428 #define SQL_CODE_MINUTE_TO_SECOND 13
430 #define SQL_INTERVAL_YEAR (100 + SQL_CODE_YEAR)
431 #define SQL_INTERVAL_MONTH (100 + SQL_CODE_MONTH)
432 #define SQL_INTERVAL_DAY (100 + SQL_CODE_DAY)
433 #define SQL_INTERVAL_HOUR (100 + SQL_CODE_HOUR)
434 #define SQL_INTERVAL_MINUTE (100 + SQL_CODE_MINUTE)
435 #define SQL_INTERVAL_SECOND (100 + SQL_CODE_SECOND)
436 #define SQL_INTERVAL_YEAR_TO_MONTH (100 + SQL_CODE_YEAR_TO_MONTH)
437 #define SQL_INTERVAL_DAY_TO_HOUR (100 + SQL_CODE_DAY_TO_HOUR)
438 #define SQL_INTERVAL_DAY_TO_MINUTE (100 + SQL_CODE_DAY_TO_MINUTE)
439 #define SQL_INTERVAL_DAY_TO_SECOND (100 + SQL_CODE_DAY_TO_SECOND)
440 #define SQL_INTERVAL_HOUR_TO_MINUTE (100 + SQL_CODE_HOUR_TO_MINUTE)
441 #define SQL_INTERVAL_HOUR_TO_SECOND (100 + SQL_CODE_HOUR_TO_SECOND)
442 #define SQL_INTERVAL_MINUTE_TO_SECOND (100 + SQL_CODE_MINUTE_TO_SECOND)
444 #else
445 #define SQL_INTERVAL_YEAR (-80)
446 #define SQL_INTERVAL_MONTH (-81)
447 #define SQL_INTERVAL_YEAR_TO_MONTH (-82)
448 #define SQL_INTERVAL_DAY (-83)
449 #define SQL_INTERVAL_HOUR (-84)
450 #define SQL_INTERVAL_MINUTE (-85)
451 #define SQL_INTERVAL_SECOND (-86)
452 #define SQL_INTERVAL_DAY_TO_HOUR (-87)
453 #define SQL_INTERVAL_DAY_TO_MINUTE (-88)
454 #define SQL_INTERVAL_DAY_TO_SECOND (-89)
455 #define SQL_INTERVAL_HOUR_TO_MINUTE (-90)
456 #define SQL_INTERVAL_HOUR_TO_SECOND (-91)
457 #define SQL_INTERVAL_MINUTE_TO_SECOND (-92)
458 #endif /* ODBCVER >= 0x0300 */
461 #if (ODBCVER <= 0x0300)
462 #define SQL_UNICODE (-95)
463 #define SQL_UNICODE_VARCHAR (-96)
464 #define SQL_UNICODE_LONGVARCHAR (-97)
465 #define SQL_UNICODE_CHAR SQL_UNICODE
466 #else
467 /* The previous definitions for SQL_UNICODE_ are historical and obsolete */
469 #define SQL_UNICODE SQL_WCHAR
470 #define SQL_UNICODE_VARCHAR SQL_WVARCHAR
471 #define SQL_UNICODE_LONGVARCHAR SQL_WLONGVARCHAR
472 #define SQL_UNICODE_CHAR SQL_WCHAR
473 #endif
475 #if (ODBCVER < 0x0300)
476 #define SQL_TYPE_DRIVER_START SQL_INTERVAL_YEAR
477 #define SQL_TYPE_DRIVER_END SQL_UNICODE_LONGVARCHAR
478 #endif /* ODBCVER < 0x0300 */
480 /* C datatype to SQL datatype mapping SQL types
481 ------------------- */
482 #define SQL_C_CHAR SQL_CHAR /* CHAR, VARCHAR, DECIMAL, NUMERIC */
483 #define SQL_C_LONG SQL_INTEGER /* INTEGER */
484 #define SQL_C_SHORT SQL_SMALLINT /* SMALLINT */
485 #define SQL_C_FLOAT SQL_REAL /* REAL */
486 #define SQL_C_DOUBLE SQL_DOUBLE /* FLOAT, DOUBLE */
487 #if (ODBCVER >= 0x0300)
488 #define SQL_C_NUMERIC SQL_NUMERIC
489 #endif /* ODBCVER >= 0x0300 */
490 #define SQL_C_DEFAULT 99
492 #define SQL_SIGNED_OFFSET (-20)
493 #define SQL_UNSIGNED_OFFSET (-22)
495 /* C datatype to SQL datatype mapping */
496 #define SQL_C_DATE SQL_DATE
497 #define SQL_C_TIME SQL_TIME
498 #define SQL_C_TIMESTAMP SQL_TIMESTAMP
499 #if (ODBCVER >= 0x0300)
500 #define SQL_C_TYPE_DATE SQL_TYPE_DATE
501 #define SQL_C_TYPE_TIME SQL_TYPE_TIME
502 #define SQL_C_TYPE_TIMESTAMP SQL_TYPE_TIMESTAMP
503 #define SQL_C_INTERVAL_YEAR SQL_INTERVAL_YEAR
504 #define SQL_C_INTERVAL_MONTH SQL_INTERVAL_MONTH
505 #define SQL_C_INTERVAL_DAY SQL_INTERVAL_DAY
506 #define SQL_C_INTERVAL_HOUR SQL_INTERVAL_HOUR
507 #define SQL_C_INTERVAL_MINUTE SQL_INTERVAL_MINUTE
508 #define SQL_C_INTERVAL_SECOND SQL_INTERVAL_SECOND
509 #define SQL_C_INTERVAL_YEAR_TO_MONTH SQL_INTERVAL_YEAR_TO_MONTH
510 #define SQL_C_INTERVAL_DAY_TO_HOUR SQL_INTERVAL_DAY_TO_HOUR
511 #define SQL_C_INTERVAL_DAY_TO_MINUTE SQL_INTERVAL_DAY_TO_MINUTE
512 #define SQL_C_INTERVAL_DAY_TO_SECOND SQL_INTERVAL_DAY_TO_SECOND
513 #define SQL_C_INTERVAL_HOUR_TO_MINUTE SQL_INTERVAL_HOUR_TO_MINUTE
514 #define SQL_C_INTERVAL_HOUR_TO_SECOND SQL_INTERVAL_HOUR_TO_SECOND
515 #define SQL_C_INTERVAL_MINUTE_TO_SECOND SQL_INTERVAL_MINUTE_TO_SECOND
516 #endif /* ODBCVER >= 0x0300 */
517 #define SQL_C_BINARY SQL_BINARY
518 #define SQL_C_BIT SQL_BIT
519 #if (ODBCVER >= 0x0300)
520 #define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */
521 #define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */
522 #endif /* ODBCVER >= 0x0300 */
523 #define SQL_C_TINYINT SQL_TINYINT
524 #define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET) /* SIGNED INTEGER */
525 #define SQL_C_SSHORT (SQL_C_SHORT+SQL_SIGNED_OFFSET) /* SIGNED SMALLINT */
526 #define SQL_C_STINYINT (SQL_TINYINT+SQL_SIGNED_OFFSET) /* SIGNED TINYINT */
527 #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/
528 #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/
529 #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/
531 #if (ODBCVER >= 0x0300) && (SIZEOF_LONG_INT == 8) && !defined(BUILD_LEGACY_64_BIT_MODE)
532 #define SQL_C_BOOKMARK SQL_C_UBIGINT /* BOOKMARK */
533 #else
534 #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */
535 #endif
537 #if (ODBCVER >= 0x0350)
538 #define SQL_C_GUID SQL_GUID
539 #endif /* ODBCVER >= 0x0350 */
541 #define SQL_TYPE_NULL 0
542 #if (ODBCVER < 0x0300)
543 #define SQL_TYPE_MIN SQL_BIT
544 #define SQL_TYPE_MAX SQL_VARCHAR
545 #endif
547 #if (ODBCVER >= 0x0300)
548 #define SQL_C_VARBOOKMARK SQL_C_BINARY
549 #endif /* ODBCVER >= 0x0300 */
551 /* define for SQL_DIAG_ROW_NUMBER and SQL_DIAG_COLUMN_NUMBER */
552 #if (ODBCVER >= 0x0300)
553 #define SQL_NO_ROW_NUMBER (-1)
554 #define SQL_NO_COLUMN_NUMBER (-1)
555 #define SQL_ROW_NUMBER_UNKNOWN (-2)
556 #define SQL_COLUMN_NUMBER_UNKNOWN (-2)
557 #endif
559 /* SQLBindParameter extensions */
560 #define SQL_DEFAULT_PARAM (-5)
561 #define SQL_IGNORE (-6)
562 #if (ODBCVER >= 0x0300)
563 #define SQL_COLUMN_IGNORE SQL_IGNORE
564 #endif /* ODBCVER >= 0x0300 */
565 #define SQL_LEN_DATA_AT_EXEC_OFFSET (-100)
566 #define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)
568 /* binary length for driver specific attributes */
569 #define SQL_LEN_BINARY_ATTR_OFFSET (-100)
570 #define SQL_LEN_BINARY_ATTR(length) (-(length)+SQL_LEN_BINARY_ATTR_OFFSET)
572 /* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter
574 #define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT
575 #define SQL_SETPARAM_VALUE_MAX (-1L)
577 /* SQLColAttributes defines */
578 #define SQL_COLUMN_COUNT 0
579 #define SQL_COLUMN_NAME 1
580 #define SQL_COLUMN_TYPE 2
581 #define SQL_COLUMN_LENGTH 3
582 #define SQL_COLUMN_PRECISION 4
583 #define SQL_COLUMN_SCALE 5
584 #define SQL_COLUMN_DISPLAY_SIZE 6
585 #define SQL_COLUMN_NULLABLE 7
586 #define SQL_COLUMN_UNSIGNED 8
587 #define SQL_COLUMN_MONEY 9
588 #define SQL_COLUMN_UPDATABLE 10
589 #define SQL_COLUMN_AUTO_INCREMENT 11
590 #define SQL_COLUMN_CASE_SENSITIVE 12
591 #define SQL_COLUMN_SEARCHABLE 13
592 #define SQL_COLUMN_TYPE_NAME 14
593 #define SQL_COLUMN_TABLE_NAME 15
594 #define SQL_COLUMN_OWNER_NAME 16
595 #define SQL_COLUMN_QUALIFIER_NAME 17
596 #define SQL_COLUMN_LABEL 18
597 #define SQL_COLATT_OPT_MAX SQL_COLUMN_LABEL
598 #if (ODBCVER < 0x0300)
599 #define SQL_COLUMN_DRIVER_START 1000
600 #endif /* ODBCVER < 0x0300 */
602 #define SQL_COLATT_OPT_MIN SQL_COLUMN_COUNT
604 /* SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE */
605 #define SQL_ATTR_READONLY 0
606 #define SQL_ATTR_WRITE 1
607 #define SQL_ATTR_READWRITE_UNKNOWN 2
609 /* SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE */
610 /* These are also used by SQLGetInfo */
611 #define SQL_UNSEARCHABLE 0
612 #define SQL_LIKE_ONLY 1
613 #define SQL_ALL_EXCEPT_LIKE 2
614 #define SQL_SEARCHABLE 3
615 #define SQL_PRED_SEARCHABLE SQL_SEARCHABLE
618 /* Special return values for SQLGetData */
619 #define SQL_NO_TOTAL (-4)
621 /********************************************/
622 /* SQLGetFunctions: additional values for */
623 /* fFunction to represent functions that */
624 /* are not in the X/Open spec. */
625 /********************************************/
627 #if (ODBCVER >= 0x0300)
628 #define SQL_API_SQLALLOCHANDLESTD 73
629 #define SQL_API_SQLBULKOPERATIONS 24
630 #endif /* ODBCVER >= 0x0300 */
631 #define SQL_API_SQLBINDPARAMETER 72
632 #define SQL_API_SQLBROWSECONNECT 55
633 #define SQL_API_SQLCOLATTRIBUTES 6
634 #define SQL_API_SQLCOLUMNPRIVILEGES 56
635 #define SQL_API_SQLDESCRIBEPARAM 58
636 #define SQL_API_SQLDRIVERCONNECT 41
637 #define SQL_API_SQLDRIVERS 71
638 #define SQL_API_SQLEXTENDEDFETCH 59
639 #define SQL_API_SQLFOREIGNKEYS 60
640 #define SQL_API_SQLMORERESULTS 61
641 #define SQL_API_SQLNATIVESQL 62
642 #define SQL_API_SQLNUMPARAMS 63
643 #define SQL_API_SQLPARAMOPTIONS 64
644 #define SQL_API_SQLPRIMARYKEYS 65
645 #define SQL_API_SQLPROCEDURECOLUMNS 66
646 #define SQL_API_SQLPROCEDURES 67
647 #define SQL_API_SQLSETPOS 68
648 #define SQL_API_SQLSETSCROLLOPTIONS 69
649 #define SQL_API_SQLTABLEPRIVILEGES 70
651 /*-------------------------------------------*/
652 /* SQL_EXT_API_LAST is not useful with ODBC */
653 /* version 3.0 because some of the values */
654 /* from X/Open are in the 10000 range. */
655 /*-------------------------------------------*/
657 #if (ODBCVER < 0x0300)
658 #define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER
659 #define SQL_NUM_FUNCTIONS 23
660 #define SQL_EXT_API_START 40
661 #define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1)
662 #endif
664 /*--------------------------------------------*/
665 /* SQL_API_ALL_FUNCTIONS returns an array */
666 /* of 'booleans' representing whether a */
667 /* function is implemented by the driver. */
668 /* */
669 /* CAUTION: Only functions defined in ODBC */
670 /* version 2.0 and earlier are returned, the */
671 /* new high-range function numbers defined by */
672 /* X/Open break this scheme. See the new */
673 /* method -- SQL_API_ODBC3_ALL_FUNCTIONS */
674 /*--------------------------------------------*/
676 #define SQL_API_ALL_FUNCTIONS 0 /* See CAUTION above */
678 /*----------------------------------------------*/
679 /* 2.X drivers export a dummy function with */
680 /* ordinal number SQL_API_LOADBYORDINAL to speed*/
681 /* loading under the windows operating system. */
682 /* */
683 /* CAUTION: Loading by ordinal is not supported */
684 /* for 3.0 and above drivers. */
685 /*----------------------------------------------*/
687 #define SQL_API_LOADBYORDINAL 199 /* See CAUTION above */
689 /*----------------------------------------------*/
690 /* SQL_API_ODBC3_ALL_FUNCTIONS */
691 /* This returns a bitmap, which allows us to */
692 /* handle the higher-valued function numbers. */
693 /* Use SQL_FUNC_EXISTS(bitmap,function_number) */
694 /* to determine if the function exists. */
695 /*----------------------------------------------*/
698 #if (ODBCVER >= 0x0300)
699 #define SQL_API_ODBC3_ALL_FUNCTIONS 999
700 #define SQL_API_ODBC3_ALL_FUNCTIONS_SIZE 250 /* array of 250 words */
703 #define SQL_FUNC_EXISTS(pfExists, uwAPI) ((*(((UWORD*) (pfExists)) + ((uwAPI) >> 4)) & (1 << ((uwAPI) & 0x000F)) ) ? SQL_TRUE : SQL_FALSE )
705 #endif /* ODBCVER >= 0x0300 */
708 /************************************************/
709 /* Extended definitions for SQLGetInfo */
710 /************************************************/
712 /*---------------------------------*/
713 /* Values in ODBC 2.0 that are not */
714 /* in the X/Open spec */
715 /*---------------------------------*/
717 #define SQL_INFO_FIRST 0
718 #define SQL_ACTIVE_CONNECTIONS 0 /* MAX_DRIVER_CONNECTIONS */
719 #define SQL_ACTIVE_STATEMENTS 1 /* MAX_CONCURRENT_ACTIVITIES */
720 #define SQL_DRIVER_HDBC 3
721 #define SQL_DRIVER_HENV 4
722 #define SQL_DRIVER_HSTMT 5
723 #define SQL_DRIVER_NAME 6
724 #define SQL_DRIVER_VER 7
725 #define SQL_ODBC_API_CONFORMANCE 9
726 #define SQL_ODBC_VER 10
727 #define SQL_ROW_UPDATES 11
728 #define SQL_ODBC_SAG_CLI_CONFORMANCE 12
729 #define SQL_ODBC_SQL_CONFORMANCE 15
730 #define SQL_PROCEDURES 21
731 #define SQL_CONCAT_NULL_BEHAVIOR 22
732 #define SQL_CURSOR_ROLLBACK_BEHAVIOR 24
733 #define SQL_EXPRESSIONS_IN_ORDERBY 27
734 #define SQL_MAX_OWNER_NAME_LEN 32 /* MAX_SCHEMA_NAME_LEN */
735 #define SQL_MAX_PROCEDURE_NAME_LEN 33
736 #define SQL_MAX_QUALIFIER_NAME_LEN 34 /* MAX_CATALOG_NAME_LEN */
737 #define SQL_MULT_RESULT_SETS 36
738 #define SQL_MULTIPLE_ACTIVE_TXN 37
739 #define SQL_OUTER_JOINS 38
740 #define SQL_OWNER_TERM 39
741 #define SQL_PROCEDURE_TERM 40
742 #define SQL_QUALIFIER_NAME_SEPARATOR 41
743 #define SQL_QUALIFIER_TERM 42
744 #define SQL_SCROLL_OPTIONS 44
745 #define SQL_TABLE_TERM 45
746 #define SQL_CONVERT_FUNCTIONS 48
747 #define SQL_NUMERIC_FUNCTIONS 49
748 #define SQL_STRING_FUNCTIONS 50
749 #define SQL_SYSTEM_FUNCTIONS 51
750 #define SQL_TIMEDATE_FUNCTIONS 52
751 #define SQL_CONVERT_BIGINT 53
752 #define SQL_CONVERT_BINARY 54
753 #define SQL_CONVERT_BIT 55
754 #define SQL_CONVERT_CHAR 56
755 #define SQL_CONVERT_DATE 57
756 #define SQL_CONVERT_DECIMAL 58
757 #define SQL_CONVERT_DOUBLE 59
758 #define SQL_CONVERT_FLOAT 60
759 #define SQL_CONVERT_INTEGER 61
760 #define SQL_CONVERT_LONGVARCHAR 62
761 #define SQL_CONVERT_NUMERIC 63
762 #define SQL_CONVERT_REAL 64
763 #define SQL_CONVERT_SMALLINT 65
764 #define SQL_CONVERT_TIME 66
765 #define SQL_CONVERT_TIMESTAMP 67
766 #define SQL_CONVERT_TINYINT 68
767 #define SQL_CONVERT_VARBINARY 69
768 #define SQL_CONVERT_VARCHAR 70
769 #define SQL_CONVERT_LONGVARBINARY 71
770 #define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */
771 #define SQL_CORRELATION_NAME 74
772 #define SQL_NON_NULLABLE_COLUMNS 75
773 #define SQL_DRIVER_HLIB 76
774 #define SQL_DRIVER_ODBC_VER 77
775 #define SQL_LOCK_TYPES 78
776 #define SQL_POS_OPERATIONS 79
777 #define SQL_POSITIONED_STATEMENTS 80
778 #define SQL_BOOKMARK_PERSISTENCE 82
779 #define SQL_STATIC_SENSITIVITY 83
780 #define SQL_FILE_USAGE 84
781 #define SQL_COLUMN_ALIAS 87
782 #define SQL_GROUP_BY 88
783 #define SQL_KEYWORDS 89
784 #define SQL_OWNER_USAGE 91
785 #define SQL_QUALIFIER_USAGE 92
786 #define SQL_QUOTED_IDENTIFIER_CASE 93
787 #define SQL_SUBQUERIES 95
788 #define SQL_UNION 96
789 #define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103
790 #define SQL_MAX_CHAR_LITERAL_LEN 108
791 #define SQL_TIMEDATE_ADD_INTERVALS 109
792 #define SQL_TIMEDATE_DIFF_INTERVALS 110
793 #define SQL_NEED_LONG_DATA_LEN 111
794 #define SQL_MAX_BINARY_LITERAL_LEN 112
795 #define SQL_LIKE_ESCAPE_CLAUSE 113
796 #define SQL_QUALIFIER_LOCATION 114
798 #if (ODBCVER >= 0x0201 && ODBCVER < 0x0300)
799 #ifndef SQL_OJ_CAPABILITIES
800 #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */
801 #endif
802 #endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */
804 /*----------------------------------------------*/
805 /* SQL_INFO_LAST and SQL_INFO_DRIVER_START are */
806 /* not useful anymore, because X/Open has */
807 /* values in the 10000 range. You */
808 /* must contact X/Open directly to get a range */
809 /* of numbers for driver-specific values. */
810 /*----------------------------------------------*/
812 #if (ODBCVER < 0x0300)
813 #define SQL_INFO_LAST SQL_QUALIFIER_LOCATION
814 #define SQL_INFO_DRIVER_START 1000
815 #endif /* ODBCVER < 0x0300 */
817 /*-----------------------------------------------*/
818 /* ODBC 3.0 SQLGetInfo values that are not part */
819 /* of the X/Open standard at this time. X/Open */
820 /* standard values are in sql.h. */
821 /*-----------------------------------------------*/
823 #if (ODBCVER >= 0x0300)
824 #define SQL_ACTIVE_ENVIRONMENTS 116
825 #define SQL_ALTER_DOMAIN 117
827 #define SQL_SQL_CONFORMANCE 118
828 #define SQL_DATETIME_LITERALS 119
830 #define SQL_ASYNC_MODE 10021 /* new X/Open spec */
831 #define SQL_BATCH_ROW_COUNT 120
832 #define SQL_BATCH_SUPPORT 121
833 #define SQL_CATALOG_LOCATION SQL_QUALIFIER_LOCATION
834 #define SQL_CATALOG_NAME_SEPARATOR SQL_QUALIFIER_NAME_SEPARATOR
835 #define SQL_CATALOG_TERM SQL_QUALIFIER_TERM
836 #define SQL_CATALOG_USAGE SQL_QUALIFIER_USAGE
837 #define SQL_CONVERT_WCHAR 122
838 #define SQL_CONVERT_INTERVAL_DAY_TIME 123
839 #define SQL_CONVERT_INTERVAL_YEAR_MONTH 124
840 #define SQL_CONVERT_WLONGVARCHAR 125
841 #define SQL_CONVERT_WVARCHAR 126
842 #define SQL_CREATE_ASSERTION 127
843 #define SQL_CREATE_CHARACTER_SET 128
844 #define SQL_CREATE_COLLATION 129
845 #define SQL_CREATE_DOMAIN 130
846 #define SQL_CREATE_SCHEMA 131
847 #define SQL_CREATE_TABLE 132
848 #define SQL_CREATE_TRANSLATION 133
849 #define SQL_CREATE_VIEW 134
850 #define SQL_DRIVER_HDESC 135
851 #define SQL_DROP_ASSERTION 136
852 #define SQL_DROP_CHARACTER_SET 137
853 #define SQL_DROP_COLLATION 138
854 #define SQL_DROP_DOMAIN 139
855 #define SQL_DROP_SCHEMA 140
856 #define SQL_DROP_TABLE 141
857 #define SQL_DROP_TRANSLATION 142
858 #define SQL_DROP_VIEW 143
859 #define SQL_DYNAMIC_CURSOR_ATTRIBUTES1 144
860 #define SQL_DYNAMIC_CURSOR_ATTRIBUTES2 145
861 #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 146
862 #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 147
863 #define SQL_INDEX_KEYWORDS 148
864 #define SQL_INFO_SCHEMA_VIEWS 149
865 #define SQL_KEYSET_CURSOR_ATTRIBUTES1 150
866 #define SQL_KEYSET_CURSOR_ATTRIBUTES2 151
867 #define SQL_MAX_ASYNC_CONCURRENT_STATEMENTS 10022 /* new X/Open spec */
868 #define SQL_ODBC_INTERFACE_CONFORMANCE 152
869 #define SQL_PARAM_ARRAY_ROW_COUNTS 153
870 #define SQL_PARAM_ARRAY_SELECTS 154
871 #define SQL_SCHEMA_TERM SQL_OWNER_TERM
872 #define SQL_SCHEMA_USAGE SQL_OWNER_USAGE
873 #define SQL_SQL92_DATETIME_FUNCTIONS 155
874 #define SQL_SQL92_FOREIGN_KEY_DELETE_RULE 156
875 #define SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 157
876 #define SQL_SQL92_GRANT 158
877 #define SQL_SQL92_NUMERIC_VALUE_FUNCTIONS 159
878 #define SQL_SQL92_PREDICATES 160
879 #define SQL_SQL92_RELATIONAL_JOIN_OPERATORS 161
880 #define SQL_SQL92_REVOKE 162
881 #define SQL_SQL92_ROW_VALUE_CONSTRUCTOR 163
882 #define SQL_SQL92_STRING_FUNCTIONS 164
883 #define SQL_SQL92_VALUE_EXPRESSIONS 165
884 #define SQL_STANDARD_CLI_CONFORMANCE 166
885 #define SQL_STATIC_CURSOR_ATTRIBUTES1 167
886 #define SQL_STATIC_CURSOR_ATTRIBUTES2 168
888 #define SQL_AGGREGATE_FUNCTIONS 169
889 #define SQL_DDL_INDEX 170
890 #define SQL_DM_VER 171
891 #define SQL_INSERT_STATEMENT 172
892 #define SQL_UNION_STATEMENT SQL_UNION
893 #endif /* ODBCVER >= 0x0300 */
895 #define SQL_DTC_TRANSITION_COST 1750
897 /* SQL_ALTER_TABLE bitmasks */
898 #if (ODBCVER >= 0x0300)
899 /* the following 5 bitmasks are defined in sql.h
900 *#define SQL_AT_ADD_COLUMN 0x00000001L
901 *#define SQL_AT_DROP_COLUMN 0x00000002L
902 *#define SQL_AT_ADD_CONSTRAINT 0x00000008L
904 #define SQL_AT_ADD_COLUMN_SINGLE 0x00000020L
905 #define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L
906 #define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L
907 #define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L
908 #define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L
909 #define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L
910 #define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L
911 #define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L
912 #define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L
913 #define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L
914 #define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L
915 #define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L
916 #define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L
917 #define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L
918 #define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L
919 #endif /* ODBCVER >= 0x0300 */
921 /* SQL_CONVERT_* return value bitmasks */
923 #define SQL_CVT_CHAR 0x00000001L
924 #define SQL_CVT_NUMERIC 0x00000002L
925 #define SQL_CVT_DECIMAL 0x00000004L
926 #define SQL_CVT_INTEGER 0x00000008L
927 #define SQL_CVT_SMALLINT 0x00000010L
928 #define SQL_CVT_FLOAT 0x00000020L
929 #define SQL_CVT_REAL 0x00000040L
930 #define SQL_CVT_DOUBLE 0x00000080L
931 #define SQL_CVT_VARCHAR 0x00000100L
932 #define SQL_CVT_LONGVARCHAR 0x00000200L
933 #define SQL_CVT_BINARY 0x00000400L
934 #define SQL_CVT_VARBINARY 0x00000800L
935 #define SQL_CVT_BIT 0x00001000L
936 #define SQL_CVT_TINYINT 0x00002000L
937 #define SQL_CVT_BIGINT 0x00004000L
938 #define SQL_CVT_DATE 0x00008000L
939 #define SQL_CVT_TIME 0x00010000L
940 #define SQL_CVT_TIMESTAMP 0x00020000L
941 #define SQL_CVT_LONGVARBINARY 0x00040000L
942 #if (ODBCVER >= 0x0300)
943 #define SQL_CVT_INTERVAL_YEAR_MONTH 0x00080000L
944 #define SQL_CVT_INTERVAL_DAY_TIME 0x00100000L
945 #define SQL_CVT_WCHAR 0x00200000L
946 #define SQL_CVT_WLONGVARCHAR 0x00400000L
947 #define SQL_CVT_WVARCHAR 0x00800000L
949 #endif /* ODBCVER >= 0x0300 */
952 /* SQL_CONVERT_FUNCTIONS functions */
953 #define SQL_FN_CVT_CONVERT 0x00000001L
954 #if (ODBCVER >= 0x0300)
955 #define SQL_FN_CVT_CAST 0x00000002L
956 #endif /* ODBCVER >= 0x0300 */
959 /* SQL_STRING_FUNCTIONS functions */
961 #define SQL_FN_STR_CONCAT 0x00000001L
962 #define SQL_FN_STR_INSERT 0x00000002L
963 #define SQL_FN_STR_LEFT 0x00000004L
964 #define SQL_FN_STR_LTRIM 0x00000008L
965 #define SQL_FN_STR_LENGTH 0x00000010L
966 #define SQL_FN_STR_LOCATE 0x00000020L
967 #define SQL_FN_STR_LCASE 0x00000040L
968 #define SQL_FN_STR_REPEAT 0x00000080L
969 #define SQL_FN_STR_REPLACE 0x00000100L
970 #define SQL_FN_STR_RIGHT 0x00000200L
971 #define SQL_FN_STR_RTRIM 0x00000400L
972 #define SQL_FN_STR_SUBSTRING 0x00000800L
973 #define SQL_FN_STR_UCASE 0x00001000L
974 #define SQL_FN_STR_ASCII 0x00002000L
975 #define SQL_FN_STR_CHAR 0x00004000L
976 #define SQL_FN_STR_DIFFERENCE 0x00008000L
977 #define SQL_FN_STR_LOCATE_2 0x00010000L
978 #define SQL_FN_STR_SOUNDEX 0x00020000L
979 #define SQL_FN_STR_SPACE 0x00040000L
980 #if (ODBCVER >= 0x0300)
981 #define SQL_FN_STR_BIT_LENGTH 0x00080000L
982 #define SQL_FN_STR_CHAR_LENGTH 0x00100000L
983 #define SQL_FN_STR_CHARACTER_LENGTH 0x00200000L
984 #define SQL_FN_STR_OCTET_LENGTH 0x00400000L
985 #define SQL_FN_STR_POSITION 0x00800000L
986 #endif /* ODBCVER >= 0x0300 */
988 /* SQL_SQL92_STRING_FUNCTIONS */
989 #if (ODBCVER >= 0x0300)
990 #define SQL_SSF_CONVERT 0x00000001L
991 #define SQL_SSF_LOWER 0x00000002L
992 #define SQL_SSF_UPPER 0x00000004L
993 #define SQL_SSF_SUBSTRING 0x00000008L
994 #define SQL_SSF_TRANSLATE 0x00000010L
995 #define SQL_SSF_TRIM_BOTH 0x00000020L
996 #define SQL_SSF_TRIM_LEADING 0x00000040L
997 #define SQL_SSF_TRIM_TRAILING 0x00000080L
998 #endif /* ODBCVER >= 0x0300 */
1000 /* SQL_NUMERIC_FUNCTIONS functions */
1002 #define SQL_FN_NUM_ABS 0x00000001L
1003 #define SQL_FN_NUM_ACOS 0x00000002L
1004 #define SQL_FN_NUM_ASIN 0x00000004L
1005 #define SQL_FN_NUM_ATAN 0x00000008L
1006 #define SQL_FN_NUM_ATAN2 0x00000010L
1007 #define SQL_FN_NUM_CEILING 0x00000020L
1008 #define SQL_FN_NUM_COS 0x00000040L
1009 #define SQL_FN_NUM_COT 0x00000080L
1010 #define SQL_FN_NUM_EXP 0x00000100L
1011 #define SQL_FN_NUM_FLOOR 0x00000200L
1012 #define SQL_FN_NUM_LOG 0x00000400L
1013 #define SQL_FN_NUM_MOD 0x00000800L
1014 #define SQL_FN_NUM_SIGN 0x00001000L
1015 #define SQL_FN_NUM_SIN 0x00002000L
1016 #define SQL_FN_NUM_SQRT 0x00004000L
1017 #define SQL_FN_NUM_TAN 0x00008000L
1018 #define SQL_FN_NUM_PI 0x00010000L
1019 #define SQL_FN_NUM_RAND 0x00020000L
1020 #define SQL_FN_NUM_DEGREES 0x00040000L
1021 #define SQL_FN_NUM_LOG10 0x00080000L
1022 #define SQL_FN_NUM_POWER 0x00100000L
1023 #define SQL_FN_NUM_RADIANS 0x00200000L
1024 #define SQL_FN_NUM_ROUND 0x00400000L
1025 #define SQL_FN_NUM_TRUNCATE 0x00800000L
1027 /* SQL_SQL92_NUMERIC_VALUE_FUNCTIONS */
1028 #if (ODBCVER >= 0x0300)
1029 #define SQL_SNVF_BIT_LENGTH 0x00000001L
1030 #define SQL_SNVF_CHAR_LENGTH 0x00000002L
1031 #define SQL_SNVF_CHARACTER_LENGTH 0x00000004L
1032 #define SQL_SNVF_EXTRACT 0x00000008L
1033 #define SQL_SNVF_OCTET_LENGTH 0x00000010L
1034 #define SQL_SNVF_POSITION 0x00000020L
1035 #endif /* ODBCVER >= 0x0300 */
1037 /* SQL_TIMEDATE_FUNCTIONS functions */
1039 #define SQL_FN_TD_NOW 0x00000001L
1040 #define SQL_FN_TD_CURDATE 0x00000002L
1041 #define SQL_FN_TD_DAYOFMONTH 0x00000004L
1042 #define SQL_FN_TD_DAYOFWEEK 0x00000008L
1043 #define SQL_FN_TD_DAYOFYEAR 0x00000010L
1044 #define SQL_FN_TD_MONTH 0x00000020L
1045 #define SQL_FN_TD_QUARTER 0x00000040L
1046 #define SQL_FN_TD_WEEK 0x00000080L
1047 #define SQL_FN_TD_YEAR 0x00000100L
1048 #define SQL_FN_TD_CURTIME 0x00000200L
1049 #define SQL_FN_TD_HOUR 0x00000400L
1050 #define SQL_FN_TD_MINUTE 0x00000800L
1051 #define SQL_FN_TD_SECOND 0x00001000L
1052 #define SQL_FN_TD_TIMESTAMPADD 0x00002000L
1053 #define SQL_FN_TD_TIMESTAMPDIFF 0x00004000L
1054 #define SQL_FN_TD_DAYNAME 0x00008000L
1055 #define SQL_FN_TD_MONTHNAME 0x00010000L
1056 #if (ODBCVER >= 0x0300)
1057 #define SQL_FN_TD_CURRENT_DATE 0x00020000L
1058 #define SQL_FN_TD_CURRENT_TIME 0x00040000L
1059 #define SQL_FN_TD_CURRENT_TIMESTAMP 0x00080000L
1060 #define SQL_FN_TD_EXTRACT 0x00100000L
1061 #endif /* ODBCVER >= 0x0300 */
1063 /* SQL_SQL92_DATETIME_FUNCTIONS */
1064 #if (ODBCVER >= 0x0300)
1065 #define SQL_SDF_CURRENT_DATE 0x00000001L
1066 #define SQL_SDF_CURRENT_TIME 0x00000002L
1067 #define SQL_SDF_CURRENT_TIMESTAMP 0x00000004L
1068 #endif /* ODBCVER >= 0x0300 */
1070 /* SQL_SYSTEM_FUNCTIONS functions */
1072 #define SQL_FN_SYS_USERNAME 0x00000001L
1073 #define SQL_FN_SYS_DBNAME 0x00000002L
1074 #define SQL_FN_SYS_IFNULL 0x00000004L
1076 /* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions */
1078 #define SQL_FN_TSI_FRAC_SECOND 0x00000001L
1079 #define SQL_FN_TSI_SECOND 0x00000002L
1080 #define SQL_FN_TSI_MINUTE 0x00000004L
1081 #define SQL_FN_TSI_HOUR 0x00000008L
1082 #define SQL_FN_TSI_DAY 0x00000010L
1083 #define SQL_FN_TSI_WEEK 0x00000020L
1084 #define SQL_FN_TSI_MONTH 0x00000040L
1085 #define SQL_FN_TSI_QUARTER 0x00000080L
1086 #define SQL_FN_TSI_YEAR 0x00000100L
1088 /* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES1,
1089 * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1,
1090 * SQL_KEYSET_CURSOR_ATTRIBUTES1, and SQL_STATIC_CURSOR_ATTRIBUTES1
1092 #if (ODBCVER >= 0x0300)
1093 /* supported SQLFetchScroll FetchOrientation's */
1094 #define SQL_CA1_NEXT 0x00000001L
1095 #define SQL_CA1_ABSOLUTE 0x00000002L
1096 #define SQL_CA1_RELATIVE 0x00000004L
1097 #define SQL_CA1_BOOKMARK 0x00000008L
1099 /* supported SQLSetPos LockType's */
1100 #define SQL_CA1_LOCK_NO_CHANGE 0x00000040L
1101 #define SQL_CA1_LOCK_EXCLUSIVE 0x00000080L
1102 #define SQL_CA1_LOCK_UNLOCK 0x00000100L
1104 /* supported SQLSetPos Operations */
1105 #define SQL_CA1_POS_POSITION 0x00000200L
1106 #define SQL_CA1_POS_UPDATE 0x00000400L
1107 #define SQL_CA1_POS_DELETE 0x00000800L
1108 #define SQL_CA1_POS_REFRESH 0x00001000L
1110 /* positioned updates and deletes */
1111 #define SQL_CA1_POSITIONED_UPDATE 0x00002000L
1112 #define SQL_CA1_POSITIONED_DELETE 0x00004000L
1113 #define SQL_CA1_SELECT_FOR_UPDATE 0x00008000L
1115 /* supported SQLBulkOperations operations */
1116 #define SQL_CA1_BULK_ADD 0x00010000L
1117 #define SQL_CA1_BULK_UPDATE_BY_BOOKMARK 0x00020000L
1118 #define SQL_CA1_BULK_DELETE_BY_BOOKMARK 0x00040000L
1119 #define SQL_CA1_BULK_FETCH_BY_BOOKMARK 0x00080000L
1120 #endif /* ODBCVER >= 0x0300 */
1122 /* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES2,
1123 * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2,
1124 * SQL_KEYSET_CURSOR_ATTRIBUTES2, and SQL_STATIC_CURSOR_ATTRIBUTES2
1126 #if (ODBCVER >= 0x0300)
1127 /* supported values for SQL_ATTR_SCROLL_CONCURRENCY */
1128 #define SQL_CA2_READ_ONLY_CONCURRENCY 0x00000001L
1129 #define SQL_CA2_LOCK_CONCURRENCY 0x00000002L
1130 #define SQL_CA2_OPT_ROWVER_CONCURRENCY 0x00000004L
1131 #define SQL_CA2_OPT_VALUES_CONCURRENCY 0x00000008L
1133 /* sensitivity of the cursor to its own inserts, deletes, and updates */
1134 #define SQL_CA2_SENSITIVITY_ADDITIONS 0x00000010L
1135 #define SQL_CA2_SENSITIVITY_DELETIONS 0x00000020L
1136 #define SQL_CA2_SENSITIVITY_UPDATES 0x00000040L
1138 /* semantics of SQL_ATTR_MAX_ROWS */
1139 #define SQL_CA2_MAX_ROWS_SELECT 0x00000080L
1140 #define SQL_CA2_MAX_ROWS_INSERT 0x00000100L
1141 #define SQL_CA2_MAX_ROWS_DELETE 0x00000200L
1142 #define SQL_CA2_MAX_ROWS_UPDATE 0x00000400L
1143 #define SQL_CA2_MAX_ROWS_CATALOG 0x00000800L
1144 #define SQL_CA2_MAX_ROWS_AFFECTS_ALL (SQL_CA2_MAX_ROWS_SELECT | SQL_CA2_MAX_ROWS_INSERT | SQL_CA2_MAX_ROWS_DELETE | SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG)
1146 /* semantics of SQL_DIAG_CURSOR_ROW_COUNT */
1147 #define SQL_CA2_CRC_EXACT 0x00001000L
1148 #define SQL_CA2_CRC_APPROXIMATE 0x00002000L
1150 /* the kinds of positioned statements that can be simulated */
1151 #define SQL_CA2_SIMULATE_NON_UNIQUE 0x00004000L
1152 #define SQL_CA2_SIMULATE_TRY_UNIQUE 0x00008000L
1153 #define SQL_CA2_SIMULATE_UNIQUE 0x00010000L
1154 #endif /* ODBCVER >= 0x0300 */
1156 /* SQL_ODBC_API_CONFORMANCE values */
1158 #define SQL_OAC_NONE 0x0000
1159 #define SQL_OAC_LEVEL1 0x0001
1160 #define SQL_OAC_LEVEL2 0x0002
1162 /* SQL_ODBC_SAG_CLI_CONFORMANCE values */
1164 #define SQL_OSCC_NOT_COMPLIANT 0x0000
1165 #define SQL_OSCC_COMPLIANT 0x0001
1167 /* SQL_ODBC_SQL_CONFORMANCE values */
1169 #define SQL_OSC_MINIMUM 0x0000
1170 #define SQL_OSC_CORE 0x0001
1171 #define SQL_OSC_EXTENDED 0x0002
1174 /* SQL_CONCAT_NULL_BEHAVIOR values */
1176 #define SQL_CB_NULL 0x0000
1177 #define SQL_CB_NON_NULL 0x0001
1179 /* SQL_SCROLL_OPTIONS masks */
1181 #define SQL_SO_FORWARD_ONLY 0x00000001L
1182 #define SQL_SO_KEYSET_DRIVEN 0x00000002L
1183 #define SQL_SO_DYNAMIC 0x00000004L
1184 #define SQL_SO_MIXED 0x00000008L
1185 #define SQL_SO_STATIC 0x00000010L
1187 /* SQL_FETCH_DIRECTION masks */
1189 /* SQL_FETCH_RESUME is no longer supported
1190 #define SQL_FD_FETCH_RESUME 0x00000040L
1192 #define SQL_FD_FETCH_BOOKMARK 0x00000080L
1194 /* SQL_TXN_ISOLATION_OPTION masks */
1195 /* SQL_TXN_VERSIONING is no longer supported
1196 #define SQL_TXN_VERSIONING 0x00000010L
1199 /* SQL_CORRELATION_NAME values */
1201 #define SQL_CN_NONE 0x0000
1202 #define SQL_CN_DIFFERENT 0x0001
1203 #define SQL_CN_ANY 0x0002
1205 /* SQL_NON_NULLABLE_COLUMNS values */
1207 #define SQL_NNC_NULL 0x0000
1208 #define SQL_NNC_NON_NULL 0x0001
1210 /* SQL_NULL_COLLATION values */
1212 #define SQL_NC_START 0x0002
1213 #define SQL_NC_END 0x0004
1215 /* SQL_FILE_USAGE values */
1217 #define SQL_FILE_NOT_SUPPORTED 0x0000
1218 #define SQL_FILE_TABLE 0x0001
1219 #define SQL_FILE_QUALIFIER 0x0002
1220 #define SQL_FILE_CATALOG SQL_FILE_QUALIFIER /* ODBC 3.0 */
1223 /* SQL_GETDATA_EXTENSIONS values */
1225 #define SQL_GD_BLOCK 0x00000004L
1226 #define SQL_GD_BOUND 0x00000008L
1228 /* SQL_POSITIONED_STATEMENTS masks */
1230 #define SQL_PS_POSITIONED_DELETE 0x00000001L
1231 #define SQL_PS_POSITIONED_UPDATE 0x00000002L
1232 #define SQL_PS_SELECT_FOR_UPDATE 0x00000004L
1234 /* SQL_GROUP_BY values */
1236 #define SQL_GB_NOT_SUPPORTED 0x0000
1237 #define SQL_GB_GROUP_BY_EQUALS_SELECT 0x0001
1238 #define SQL_GB_GROUP_BY_CONTAINS_SELECT 0x0002
1239 #define SQL_GB_NO_RELATION 0x0003
1240 #if (ODBCVER >= 0x0300)
1241 #define SQL_GB_COLLATE 0x0004
1243 #endif /* ODBCVER >= 0x0300 */
1245 /* SQL_OWNER_USAGE masks */
1247 #define SQL_OU_DML_STATEMENTS 0x00000001L
1248 #define SQL_OU_PROCEDURE_INVOCATION 0x00000002L
1249 #define SQL_OU_TABLE_DEFINITION 0x00000004L
1250 #define SQL_OU_INDEX_DEFINITION 0x00000008L
1251 #define SQL_OU_PRIVILEGE_DEFINITION 0x00000010L
1253 /* SQL_SCHEMA_USAGE masks */
1254 #if (ODBCVER >= 0x0300)
1255 #define SQL_SU_DML_STATEMENTS SQL_OU_DML_STATEMENTS
1256 #define SQL_SU_PROCEDURE_INVOCATION SQL_OU_PROCEDURE_INVOCATION
1257 #define SQL_SU_TABLE_DEFINITION SQL_OU_TABLE_DEFINITION
1258 #define SQL_SU_INDEX_DEFINITION SQL_OU_INDEX_DEFINITION
1259 #define SQL_SU_PRIVILEGE_DEFINITION SQL_OU_PRIVILEGE_DEFINITION
1260 #endif /* ODBCVER >= 0x0300 */
1262 /* SQL_QUALIFIER_USAGE masks */
1264 #define SQL_QU_DML_STATEMENTS 0x00000001L
1265 #define SQL_QU_PROCEDURE_INVOCATION 0x00000002L
1266 #define SQL_QU_TABLE_DEFINITION 0x00000004L
1267 #define SQL_QU_INDEX_DEFINITION 0x00000008L
1268 #define SQL_QU_PRIVILEGE_DEFINITION 0x00000010L
1270 #if (ODBCVER >= 0x0300)
1271 /* SQL_CATALOG_USAGE masks */
1272 #define SQL_CU_DML_STATEMENTS SQL_QU_DML_STATEMENTS
1273 #define SQL_CU_PROCEDURE_INVOCATION SQL_QU_PROCEDURE_INVOCATION
1274 #define SQL_CU_TABLE_DEFINITION SQL_QU_TABLE_DEFINITION
1275 #define SQL_CU_INDEX_DEFINITION SQL_QU_INDEX_DEFINITION
1276 #define SQL_CU_PRIVILEGE_DEFINITION SQL_QU_PRIVILEGE_DEFINITION
1277 #endif /* ODBCVER >= 0x0300 */
1279 /* SQL_SUBQUERIES masks */
1281 #define SQL_SQ_COMPARISON 0x00000001L
1282 #define SQL_SQ_EXISTS 0x00000002L
1283 #define SQL_SQ_IN 0x00000004L
1284 #define SQL_SQ_QUANTIFIED 0x00000008L
1285 #define SQL_SQ_CORRELATED_SUBQUERIES 0x00000010L
1287 /* SQL_UNION masks */
1289 #define SQL_U_UNION 0x00000001L
1290 #define SQL_U_UNION_ALL 0x00000002L
1292 /* SQL_BOOKMARK_PERSISTENCE values */
1294 #define SQL_BP_CLOSE 0x00000001L
1295 #define SQL_BP_DELETE 0x00000002L
1296 #define SQL_BP_DROP 0x00000004L
1297 #define SQL_BP_TRANSACTION 0x00000008L
1298 #define SQL_BP_UPDATE 0x00000010L
1299 #define SQL_BP_OTHER_HSTMT 0x00000020L
1300 #define SQL_BP_SCROLL 0x00000040L
1302 /* SQL_STATIC_SENSITIVITY values */
1304 #define SQL_SS_ADDITIONS 0x00000001L
1305 #define SQL_SS_DELETIONS 0x00000002L
1306 #define SQL_SS_UPDATES 0x00000004L
1308 /* SQL_VIEW values */
1309 #define SQL_CV_CREATE_VIEW 0x00000001L
1310 #define SQL_CV_CHECK_OPTION 0x00000002L
1311 #define SQL_CV_CASCADED 0x00000004L
1312 #define SQL_CV_LOCAL 0x00000008L
1314 /* SQL_LOCK_TYPES masks */
1316 #define SQL_LCK_NO_CHANGE 0x00000001L
1317 #define SQL_LCK_EXCLUSIVE 0x00000002L
1318 #define SQL_LCK_UNLOCK 0x00000004L
1320 /* SQL_POS_OPERATIONS masks */
1322 #define SQL_POS_POSITION 0x00000001L
1323 #define SQL_POS_REFRESH 0x00000002L
1324 #define SQL_POS_UPDATE 0x00000004L
1325 #define SQL_POS_DELETE 0x00000008L
1326 #define SQL_POS_ADD 0x00000010L
1328 /* SQL_QUALIFIER_LOCATION values */
1330 #define SQL_QL_START 0x0001
1331 #define SQL_QL_END 0x0002
1333 /* Here start return values for ODBC 3.0 SQLGetInfo */
1335 #if (ODBCVER >= 0x0300)
1336 /* SQL_AGGREGATE_FUNCTIONS bitmasks */
1337 #define SQL_AF_AVG 0x00000001L
1338 #define SQL_AF_COUNT 0x00000002L
1339 #define SQL_AF_MAX 0x00000004L
1340 #define SQL_AF_MIN 0x00000008L
1341 #define SQL_AF_SUM 0x00000010L
1342 #define SQL_AF_DISTINCT 0x00000020L
1343 #define SQL_AF_ALL 0x00000040L
1345 /* SQL_SQL_CONFORMANCE bit masks */
1346 #define SQL_SC_SQL92_ENTRY 0x00000001L
1347 #define SQL_SC_FIPS127_2_TRANSITIONAL 0x00000002L
1348 #define SQL_SC_SQL92_INTERMEDIATE 0x00000004L
1349 #define SQL_SC_SQL92_FULL 0x00000008L
1351 /* SQL_DATETIME_LITERALS masks */
1352 #define SQL_DL_SQL92_DATE 0x00000001L
1353 #define SQL_DL_SQL92_TIME 0x00000002L
1354 #define SQL_DL_SQL92_TIMESTAMP 0x00000004L
1355 #define SQL_DL_SQL92_INTERVAL_YEAR 0x00000008L
1356 #define SQL_DL_SQL92_INTERVAL_MONTH 0x00000010L
1357 #define SQL_DL_SQL92_INTERVAL_DAY 0x00000020L
1358 #define SQL_DL_SQL92_INTERVAL_HOUR 0x00000040L
1359 #define SQL_DL_SQL92_INTERVAL_MINUTE 0x00000080L
1360 #define SQL_DL_SQL92_INTERVAL_SECOND 0x00000100L
1361 #define SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH 0x00000200L
1362 #define SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR 0x00000400L
1363 #define SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE 0x00000800L
1364 #define SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND 0x00001000L
1365 #define SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE 0x00002000L
1366 #define SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND 0x00004000L
1367 #define SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND 0x00008000L
1369 /* SQL_CATALOG_LOCATION values */
1370 #define SQL_CL_START SQL_QL_START
1371 #define SQL_CL_END SQL_QL_END
1373 /* values for SQL_BATCH_ROW_COUNT */
1374 #define SQL_BRC_PROCEDURES 0x0000001
1375 #define SQL_BRC_EXPLICIT 0x0000002
1376 #define SQL_BRC_ROLLED_UP 0x0000004
1378 /* bitmasks for SQL_BATCH_SUPPORT */
1379 #define SQL_BS_SELECT_EXPLICIT 0x00000001L
1380 #define SQL_BS_ROW_COUNT_EXPLICIT 0x00000002L
1381 #define SQL_BS_SELECT_PROC 0x00000004L
1382 #define SQL_BS_ROW_COUNT_PROC 0x00000008L
1384 /* Values for SQL_PARAM_ARRAY_ROW_COUNTS getinfo */
1385 #define SQL_PARC_BATCH 1
1386 #define SQL_PARC_NO_BATCH 2
1388 /* values for SQL_PARAM_ARRAY_SELECTS */
1389 #define SQL_PAS_BATCH 1
1390 #define SQL_PAS_NO_BATCH 2
1391 #define SQL_PAS_NO_SELECT 3
1393 /* Bitmasks for SQL_INDEX_KEYWORDS */
1394 #define SQL_IK_NONE 0x00000000L
1395 #define SQL_IK_ASC 0x00000001L
1396 #define SQL_IK_DESC 0x00000002L
1397 #define SQL_IK_ALL (SQL_IK_ASC | SQL_IK_DESC)
1399 /* Bitmasks for SQL_INFO_SCHEMA_VIEWS */
1401 #define SQL_ISV_ASSERTIONS 0x00000001L
1402 #define SQL_ISV_CHARACTER_SETS 0x00000002L
1403 #define SQL_ISV_CHECK_CONSTRAINTS 0x00000004L
1404 #define SQL_ISV_COLLATIONS 0x00000008L
1405 #define SQL_ISV_COLUMN_DOMAIN_USAGE 0x00000010L
1406 #define SQL_ISV_COLUMN_PRIVILEGES 0x00000020L
1407 #define SQL_ISV_COLUMNS 0x00000040L
1408 #define SQL_ISV_CONSTRAINT_COLUMN_USAGE 0x00000080L
1409 #define SQL_ISV_CONSTRAINT_TABLE_USAGE 0x00000100L
1410 #define SQL_ISV_DOMAIN_CONSTRAINTS 0x00000200L
1411 #define SQL_ISV_DOMAINS 0x00000400L
1412 #define SQL_ISV_KEY_COLUMN_USAGE 0x00000800L
1413 #define SQL_ISV_REFERENTIAL_CONSTRAINTS 0x00001000L
1414 #define SQL_ISV_SCHEMATA 0x00002000L
1415 #define SQL_ISV_SQL_LANGUAGES 0x00004000L
1416 #define SQL_ISV_TABLE_CONSTRAINTS 0x00008000L
1417 #define SQL_ISV_TABLE_PRIVILEGES 0x00010000L
1418 #define SQL_ISV_TABLES 0x00020000L
1419 #define SQL_ISV_TRANSLATIONS 0x00040000L
1420 #define SQL_ISV_USAGE_PRIVILEGES 0x00080000L
1421 #define SQL_ISV_VIEW_COLUMN_USAGE 0x00100000L
1422 #define SQL_ISV_VIEW_TABLE_USAGE 0x00200000L
1423 #define SQL_ISV_VIEWS 0x00400000L
1425 /* Bitmasks for SQL_ASYNC_MODE */
1427 #define SQL_AM_NONE 0
1428 #define SQL_AM_CONNECTION 1
1429 #define SQL_AM_STATEMENT 2
1431 /* Bitmasks for SQL_ALTER_DOMAIN */
1432 #define SQL_AD_CONSTRAINT_NAME_DEFINITION 0x00000001L
1433 #define SQL_AD_ADD_DOMAIN_CONSTRAINT 0x00000002L
1434 #define SQL_AD_DROP_DOMAIN_CONSTRAINT 0x00000004L
1435 #define SQL_AD_ADD_DOMAIN_DEFAULT 0x00000008L
1436 #define SQL_AD_DROP_DOMAIN_DEFAULT 0x00000010L
1437 #define SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
1438 #define SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
1439 #define SQL_AD_ADD_CONSTRAINT_DEFERRABLE 0x00000080L
1440 #define SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE 0x00000100L
1443 /* SQL_CREATE_SCHEMA bitmasks */
1444 #define SQL_CS_CREATE_SCHEMA 0x00000001L
1445 #define SQL_CS_AUTHORIZATION 0x00000002L
1446 #define SQL_CS_DEFAULT_CHARACTER_SET 0x00000004L
1448 /* SQL_CREATE_TRANSLATION bitmasks */
1449 #define SQL_CTR_CREATE_TRANSLATION 0x00000001L
1451 /* SQL_CREATE_ASSERTION bitmasks */
1452 #define SQL_CA_CREATE_ASSERTION 0x00000001L
1453 #define SQL_CA_CONSTRAINT_INITIALLY_DEFERRED 0x00000010L
1454 #define SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000020L
1455 #define SQL_CA_CONSTRAINT_DEFERRABLE 0x00000040L
1456 #define SQL_CA_CONSTRAINT_NON_DEFERRABLE 0x00000080L
1458 /* SQL_CREATE_CHARACTER_SET bitmasks */
1459 #define SQL_CCS_CREATE_CHARACTER_SET 0x00000001L
1460 #define SQL_CCS_COLLATE_CLAUSE 0x00000002L
1461 #define SQL_CCS_LIMITED_COLLATION 0x00000004L
1463 /* SQL_CREATE_COLLATION bitmasks */
1464 #define SQL_CCOL_CREATE_COLLATION 0x00000001L
1466 /* SQL_CREATE_DOMAIN bitmasks */
1467 #define SQL_CDO_CREATE_DOMAIN 0x00000001L
1468 #define SQL_CDO_DEFAULT 0x00000002L
1469 #define SQL_CDO_CONSTRAINT 0x00000004L
1470 #define SQL_CDO_COLLATION 0x00000008L
1471 #define SQL_CDO_CONSTRAINT_NAME_DEFINITION 0x00000010L
1472 #define SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
1473 #define SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
1474 #define SQL_CDO_CONSTRAINT_DEFERRABLE 0x00000080L
1475 #define SQL_CDO_CONSTRAINT_NON_DEFERRABLE 0x00000100L
1477 /* SQL_CREATE_TABLE bitmasks */
1478 #define SQL_CT_CREATE_TABLE 0x00000001L
1479 #define SQL_CT_COMMIT_PRESERVE 0x00000002L
1480 #define SQL_CT_COMMIT_DELETE 0x00000004L
1481 #define SQL_CT_GLOBAL_TEMPORARY 0x00000008L
1482 #define SQL_CT_LOCAL_TEMPORARY 0x00000010L
1483 #define SQL_CT_CONSTRAINT_INITIALLY_DEFERRED 0x00000020L
1484 #define SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00000040L
1485 #define SQL_CT_CONSTRAINT_DEFERRABLE 0x00000080L
1486 #define SQL_CT_CONSTRAINT_NON_DEFERRABLE 0x00000100L
1487 #define SQL_CT_COLUMN_CONSTRAINT 0x00000200L
1488 #define SQL_CT_COLUMN_DEFAULT 0x00000400L
1489 #define SQL_CT_COLUMN_COLLATION 0x00000800L
1490 #define SQL_CT_TABLE_CONSTRAINT 0x00001000L
1491 #define SQL_CT_CONSTRAINT_NAME_DEFINITION 0x00002000L
1493 /* SQL_DDL_INDEX bitmasks */
1494 #define SQL_DI_CREATE_INDEX 0x00000001L
1495 #define SQL_DI_DROP_INDEX 0x00000002L
1497 /* SQL_DROP_COLLATION bitmasks */
1498 #define SQL_DC_DROP_COLLATION 0x00000001L
1500 /* SQL_DROP_DOMAIN bitmasks */
1501 #define SQL_DD_DROP_DOMAIN 0x00000001L
1502 #define SQL_DD_RESTRICT 0x00000002L
1503 #define SQL_DD_CASCADE 0x00000004L
1505 /* SQL_DROP_SCHEMA bitmasks */
1506 #define SQL_DS_DROP_SCHEMA 0x00000001L
1507 #define SQL_DS_RESTRICT 0x00000002L
1508 #define SQL_DS_CASCADE 0x00000004L
1510 /* SQL_DROP_CHARACTER_SET bitmasks */
1511 #define SQL_DCS_DROP_CHARACTER_SET 0x00000001L
1513 /* SQL_DROP_ASSERTION bitmasks */
1514 #define SQL_DA_DROP_ASSERTION 0x00000001L
1516 /* SQL_DROP_TABLE bitmasks */
1517 #define SQL_DT_DROP_TABLE 0x00000001L
1518 #define SQL_DT_RESTRICT 0x00000002L
1519 #define SQL_DT_CASCADE 0x00000004L
1521 /* SQL_DROP_TRANSLATION bitmasks */
1522 #define SQL_DTR_DROP_TRANSLATION 0x00000001L
1524 /* SQL_DROP_VIEW bitmasks */
1525 #define SQL_DV_DROP_VIEW 0x00000001L
1526 #define SQL_DV_RESTRICT 0x00000002L
1527 #define SQL_DV_CASCADE 0x00000004L
1529 /* SQL_INSERT_STATEMENT bitmasks */
1530 #define SQL_IS_INSERT_LITERALS 0x00000001L
1531 #define SQL_IS_INSERT_SEARCHED 0x00000002L
1532 #define SQL_IS_SELECT_INTO 0x00000004L
1534 /* SQL_ODBC_INTERFACE_CONFORMANCE values */
1535 #define SQL_OIC_CORE 1UL
1536 #define SQL_OIC_LEVEL1 2UL
1537 #define SQL_OIC_LEVEL2 3UL
1539 /* SQL_SQL92_FOREIGN_KEY_DELETE_RULE bitmasks */
1540 #define SQL_SFKD_CASCADE 0x00000001L
1541 #define SQL_SFKD_NO_ACTION 0x00000002L
1542 #define SQL_SFKD_SET_DEFAULT 0x00000004L
1543 #define SQL_SFKD_SET_NULL 0x00000008L
1545 /* SQL_SQL92_FOREIGN_KEY_UPDATE_RULE bitmasks */
1546 #define SQL_SFKU_CASCADE 0x00000001L
1547 #define SQL_SFKU_NO_ACTION 0x00000002L
1548 #define SQL_SFKU_SET_DEFAULT 0x00000004L
1549 #define SQL_SFKU_SET_NULL 0x00000008L
1551 /* SQL_SQL92_GRANT bitmasks */
1552 #define SQL_SG_USAGE_ON_DOMAIN 0x00000001L
1553 #define SQL_SG_USAGE_ON_CHARACTER_SET 0x00000002L
1554 #define SQL_SG_USAGE_ON_COLLATION 0x00000004L
1555 #define SQL_SG_USAGE_ON_TRANSLATION 0x00000008L
1556 #define SQL_SG_WITH_GRANT_OPTION 0x00000010L
1557 #define SQL_SG_DELETE_TABLE 0x00000020L
1558 #define SQL_SG_INSERT_TABLE 0x00000040L
1559 #define SQL_SG_INSERT_COLUMN 0x00000080L
1560 #define SQL_SG_REFERENCES_TABLE 0x00000100L
1561 #define SQL_SG_REFERENCES_COLUMN 0x00000200L
1562 #define SQL_SG_SELECT_TABLE 0x00000400L
1563 #define SQL_SG_UPDATE_TABLE 0x00000800L
1564 #define SQL_SG_UPDATE_COLUMN 0x00001000L
1566 /* SQL_SQL92_PREDICATES bitmasks */
1567 #define SQL_SP_EXISTS 0x00000001L
1568 #define SQL_SP_ISNOTNULL 0x00000002L
1569 #define SQL_SP_ISNULL 0x00000004L
1570 #define SQL_SP_MATCH_FULL 0x00000008L
1571 #define SQL_SP_MATCH_PARTIAL 0x00000010L
1572 #define SQL_SP_MATCH_UNIQUE_FULL 0x00000020L
1573 #define SQL_SP_MATCH_UNIQUE_PARTIAL 0x00000040L
1574 #define SQL_SP_OVERLAPS 0x00000080L
1575 #define SQL_SP_UNIQUE 0x00000100L
1576 #define SQL_SP_LIKE 0x00000200L
1577 #define SQL_SP_IN 0x00000400L
1578 #define SQL_SP_BETWEEN 0x00000800L
1579 #define SQL_SP_COMPARISON 0x00001000L
1580 #define SQL_SP_QUANTIFIED_COMPARISON 0x00002000L
1582 /* SQL_SQL92_RELATIONAL_JOIN_OPERATORS bitmasks */
1583 #define SQL_SRJO_CORRESPONDING_CLAUSE 0x00000001L
1584 #define SQL_SRJO_CROSS_JOIN 0x00000002L
1585 #define SQL_SRJO_EXCEPT_JOIN 0x00000004L
1586 #define SQL_SRJO_FULL_OUTER_JOIN 0x00000008L
1587 #define SQL_SRJO_INNER_JOIN 0x00000010L
1588 #define SQL_SRJO_INTERSECT_JOIN 0x00000020L
1589 #define SQL_SRJO_LEFT_OUTER_JOIN 0x00000040L
1590 #define SQL_SRJO_NATURAL_JOIN 0x00000080L
1591 #define SQL_SRJO_RIGHT_OUTER_JOIN 0x00000100L
1592 #define SQL_SRJO_UNION_JOIN 0x00000200L
1594 /* SQL_SQL92_REVOKE bitmasks */
1595 #define SQL_SR_USAGE_ON_DOMAIN 0x00000001L
1596 #define SQL_SR_USAGE_ON_CHARACTER_SET 0x00000002L
1597 #define SQL_SR_USAGE_ON_COLLATION 0x00000004L
1598 #define SQL_SR_USAGE_ON_TRANSLATION 0x00000008L
1599 #define SQL_SR_GRANT_OPTION_FOR 0x00000010L
1600 #define SQL_SR_CASCADE 0x00000020L
1601 #define SQL_SR_RESTRICT 0x00000040L
1602 #define SQL_SR_DELETE_TABLE 0x00000080L
1603 #define SQL_SR_INSERT_TABLE 0x00000100L
1604 #define SQL_SR_INSERT_COLUMN 0x00000200L
1605 #define SQL_SR_REFERENCES_TABLE 0x00000400L
1606 #define SQL_SR_REFERENCES_COLUMN 0x00000800L
1607 #define SQL_SR_SELECT_TABLE 0x00001000L
1608 #define SQL_SR_UPDATE_TABLE 0x00002000L
1609 #define SQL_SR_UPDATE_COLUMN 0x00004000L
1611 /* SQL_SQL92_ROW_VALUE_CONSTRUCTOR bitmasks */
1612 #define SQL_SRVC_VALUE_EXPRESSION 0x00000001L
1613 #define SQL_SRVC_NULL 0x00000002L
1614 #define SQL_SRVC_DEFAULT 0x00000004L
1615 #define SQL_SRVC_ROW_SUBQUERY 0x00000008L
1617 /* SQL_SQL92_VALUE_EXPRESSIONS bitmasks */
1618 #define SQL_SVE_CASE 0x00000001L
1619 #define SQL_SVE_CAST 0x00000002L
1620 #define SQL_SVE_COALESCE 0x00000004L
1621 #define SQL_SVE_NULLIF 0x00000008L
1623 /* SQL_STANDARD_CLI_CONFORMANCE bitmasks */
1624 #define SQL_SCC_XOPEN_CLI_VERSION1 0x00000001L
1625 #define SQL_SCC_ISO92_CLI 0x00000002L
1627 /* SQL_UNION_STATEMENT bitmasks */
1628 #define SQL_US_UNION SQL_U_UNION
1629 #define SQL_US_UNION_ALL SQL_U_UNION_ALL
1631 #endif /* ODBCVER >= 0x0300 */
1633 /* SQL_DTC_TRANSITION_COST bitmasks */
1634 #define SQL_DTC_ENLIST_EXPENSIVE 0x00000001L
1635 #define SQL_DTC_UNENLIST_EXPENSIVE 0x00000002L
1637 /* additional SQLDataSources fetch directions */
1638 #if (ODBCVER >= 0x0300)
1639 #define SQL_FETCH_FIRST_USER 31
1640 #define SQL_FETCH_FIRST_SYSTEM 32
1641 #endif /* ODBCVER >= 0x0300 */
1644 /* Defines for SQLSetPos */
1645 #define SQL_ENTIRE_ROWSET 0
1647 /* Operations in SQLSetPos */
1648 #define SQL_POSITION 0 /* 1.0 FALSE */
1649 #define SQL_REFRESH 1 /* 1.0 TRUE */
1650 #define SQL_UPDATE 2
1651 #define SQL_DELETE 3
1653 /* Operations in SQLBulkOperations */
1654 #define SQL_ADD 4
1655 #define SQL_SETPOS_MAX_OPTION_VALUE SQL_ADD
1656 #if (ODBCVER >= 0x0300)
1657 #define SQL_UPDATE_BY_BOOKMARK 5
1658 #define SQL_DELETE_BY_BOOKMARK 6
1659 #define SQL_FETCH_BY_BOOKMARK 7
1661 #endif /* ODBCVER >= 0x0300 */
1663 /* Lock options in SQLSetPos */
1664 #define SQL_LOCK_NO_CHANGE 0 /* 1.0 FALSE */
1665 #define SQL_LOCK_EXCLUSIVE 1 /* 1.0 TRUE */
1666 #define SQL_LOCK_UNLOCK 2
1668 #define SQL_SETPOS_MAX_LOCK_VALUE SQL_LOCK_UNLOCK
1670 /* Macros for SQLSetPos */
1671 #define SQL_POSITION_TO(hstmt,irow) SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE)
1672 #define SQL_LOCK_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_POSITION,fLock)
1673 #define SQL_REFRESH_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_REFRESH,fLock)
1674 #define SQL_UPDATE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE)
1675 #define SQL_DELETE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE)
1676 #define SQL_ADD_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE)
1678 /* Column types and scopes in SQLSpecialColumns. */
1679 #define SQL_BEST_ROWID 1
1680 #define SQL_ROWVER 2
1682 /* Defines for SQLSpecialColumns (returned in the result set)
1683 SQL_PC_UNKNOWN and SQL_PC_PSEUDO are defined in sql.h */
1684 #define SQL_PC_NOT_PSEUDO 1
1686 /* Defines for SQLStatistics */
1687 #define SQL_QUICK 0
1688 #define SQL_ENSURE 1
1690 /* Defines for SQLStatistics (returned in the result set)
1691 SQL_INDEX_CLUSTERED, SQL_INDEX_HASHED, and SQL_INDEX_OTHER are
1692 defined in sql.h */
1693 #define SQL_TABLE_STAT 0
1696 /* Defines for SQLTables */
1697 #if (ODBCVER >= 0x0300)
1698 #define SQL_ALL_CATALOGS "%"
1699 #define SQL_ALL_SCHEMAS "%"
1700 #define SQL_ALL_TABLE_TYPES "%"
1701 #endif /* ODBCVER >= 0x0300 */
1703 /* Options for SQLDriverConnect */
1704 #define SQL_DRIVER_NOPROMPT 0
1705 #define SQL_DRIVER_COMPLETE 1
1706 #define SQL_DRIVER_PROMPT 2
1707 #define SQL_DRIVER_COMPLETE_REQUIRED 3
1709 SQLRETURN SQL_API SQLDriverConnect(
1710 SQLHDBC hdbc,
1711 SQLHWND hwnd,
1712 SQLCHAR *szConnStrIn,
1713 SQLSMALLINT cbConnStrIn,
1714 SQLCHAR *szConnStrOut,
1715 SQLSMALLINT cbConnStrOutMax,
1716 SQLSMALLINT *pcbConnStrOut,
1717 SQLUSMALLINT fDriverCompletion);
1719 /* Level 2 Functions */
1721 /* SQLExtendedFetch "fFetchType" values */
1722 #define SQL_FETCH_BOOKMARK 8
1724 /* SQLExtendedFetch "rgfRowStatus" element values */
1725 #define SQL_ROW_SUCCESS 0
1726 #define SQL_ROW_DELETED 1
1727 #define SQL_ROW_UPDATED 2
1728 #define SQL_ROW_NOROW 3
1729 #define SQL_ROW_ADDED 4
1730 #define SQL_ROW_ERROR 5
1731 #if (ODBCVER >= 0x0300)
1732 #define SQL_ROW_SUCCESS_WITH_INFO 6
1733 #define SQL_ROW_PROCEED 0
1734 #define SQL_ROW_IGNORE 1
1735 #endif
1737 /* value for SQL_DESC_ARRAY_STATUS_PTR */
1738 #if (ODBCVER >= 0x0300)
1739 #define SQL_PARAM_SUCCESS 0
1740 #define SQL_PARAM_SUCCESS_WITH_INFO 6
1741 #define SQL_PARAM_ERROR 5
1742 #define SQL_PARAM_UNUSED 7
1743 #define SQL_PARAM_DIAG_UNAVAILABLE 1
1745 #define SQL_PARAM_PROCEED 0
1746 #define SQL_PARAM_IGNORE 1
1747 #endif /* ODBCVER >= 0x0300 */
1749 /* Defines for SQLForeignKeys (UPDATE_RULE and DELETE_RULE) */
1750 #define SQL_CASCADE 0
1751 #define SQL_RESTRICT 1
1752 #define SQL_SET_NULL 2
1753 #if (ODBCVER >= 0x0250)
1754 #define SQL_NO_ACTION 3
1755 #define SQL_SET_DEFAULT 4
1756 #endif /* ODBCVER >= 0x0250 */
1758 #if (ODBCVER >= 0x0300)
1759 /* Note that the following are in a different column of SQLForeignKeys than */
1760 /* the previous #defines. These are for DEFERRABILITY. */
1762 #define SQL_INITIALLY_DEFERRED 5
1763 #define SQL_INITIALLY_IMMEDIATE 6
1764 #define SQL_NOT_DEFERRABLE 7
1766 #endif /* ODBCVER >= 0x0300 */
1768 /* Defines for SQLBindParameter and
1769 SQLProcedureColumns (returned in the result set) */
1770 #define SQL_PARAM_TYPE_UNKNOWN 0
1771 #define SQL_PARAM_INPUT 1
1772 #define SQL_PARAM_INPUT_OUTPUT 2
1773 #define SQL_RESULT_COL 3
1774 #define SQL_PARAM_OUTPUT 4
1775 #define SQL_RETURN_VALUE 5
1777 /* Defines for SQLProcedures (returned in the result set) */
1778 #define SQL_PT_UNKNOWN 0
1779 #define SQL_PT_PROCEDURE 1
1780 #define SQL_PT_FUNCTION 2
1782 /* This define is too large for RC */
1783 #define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\
1784 "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\
1785 "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\
1786 "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\
1787 "COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\
1788 "CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\
1789 "CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\
1790 "DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\
1791 "DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\
1792 "DISTINCT,DOMAIN,DOUBLE,DROP,"\
1793 "ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\
1794 "EXISTS,EXTERNAL,EXTRACT,"\
1795 "FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\
1796 "GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\
1797 "IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\
1798 "INPUT,INSENSITIVE,INSERT,INT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\
1799 "JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\
1800 "MATCH,MAX,MIN,MINUTE,MODULE,MONTH,"\
1801 "NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\
1802 "OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\
1803 "PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\
1804 "PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\
1805 "READ,REAL,REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS"\
1806 "SCHEMA,SCROLL,SECOND,SECTION,SELECT,SESSION,SESSION_USER,SET,SIZE,"\
1807 "SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\
1808 "SUBSTRING,SUM,SYSTEM_USER,"\
1809 "TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\
1810 "TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\
1811 "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\
1812 "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\
1813 "YEAR,ZONE"
1815 SQLRETURN SQL_API SQLBrowseConnect(
1816 SQLHDBC hdbc,
1817 SQLCHAR *szConnStrIn,
1818 SQLSMALLINT cbConnStrIn,
1819 SQLCHAR *szConnStrOut,
1820 SQLSMALLINT cbConnStrOutMax,
1821 SQLSMALLINT *pcbConnStrOut);
1823 #if (ODBCVER >= 0x0300)
1824 SQLRETURN SQL_API SQLBulkOperations(
1825 SQLHSTMT StatementHandle,
1826 SQLSMALLINT Operation);
1827 #endif /* ODBCVER >= 0x0300 */
1829 SQLRETURN SQL_API SQLColAttributes(
1830 SQLHSTMT hstmt,
1831 SQLUSMALLINT icol,
1832 SQLUSMALLINT fDescType,
1833 SQLPOINTER rgbDesc,
1834 SQLSMALLINT cbDescMax,
1835 SQLSMALLINT *pcbDesc,
1836 SQLLEN *pfDesc);
1838 SQLRETURN SQL_API SQLColumnPrivileges(
1839 SQLHSTMT hstmt,
1840 SQLCHAR *szCatalogName,
1841 SQLSMALLINT cbCatalogName,
1842 SQLCHAR *szSchemaName,
1843 SQLSMALLINT cbSchemaName,
1844 SQLCHAR *szTableName,
1845 SQLSMALLINT cbTableName,
1846 SQLCHAR *szColumnName,
1847 SQLSMALLINT cbColumnName);
1849 SQLRETURN SQL_API SQLDescribeParam(
1850 SQLHSTMT hstmt,
1851 SQLUSMALLINT ipar,
1852 SQLSMALLINT *pfSqlType,
1853 SQLULEN *pcbParamDef,
1854 SQLSMALLINT *pibScale,
1855 SQLSMALLINT *pfNullable);
1857 SQLRETURN SQL_API SQLExtendedFetch(
1858 SQLHSTMT hstmt,
1859 SQLUSMALLINT fFetchType,
1860 SQLROWOFFSET irow,
1861 SQLROWSETSIZE *pcrow,
1862 SQLUSMALLINT *rgfRowStatus);
1864 SQLRETURN SQL_API SQLForeignKeys(
1865 SQLHSTMT hstmt,
1866 SQLCHAR *szPkCatalogName,
1867 SQLSMALLINT cbPkCatalogName,
1868 SQLCHAR *szPkSchemaName,
1869 SQLSMALLINT cbPkSchemaName,
1870 SQLCHAR *szPkTableName,
1871 SQLSMALLINT cbPkTableName,
1872 SQLCHAR *szFkCatalogName,
1873 SQLSMALLINT cbFkCatalogName,
1874 SQLCHAR *szFkSchemaName,
1875 SQLSMALLINT cbFkSchemaName,
1876 SQLCHAR *szFkTableName,
1877 SQLSMALLINT cbFkTableName);
1879 SQLRETURN SQL_API SQLMoreResults(
1880 SQLHSTMT hstmt);
1882 SQLRETURN SQL_API SQLNativeSql(
1883 SQLHDBC hdbc,
1884 SQLCHAR *szSqlStrIn,
1885 SQLINTEGER cbSqlStrIn,
1886 SQLCHAR *szSqlStr,
1887 SQLINTEGER cbSqlStrMax,
1888 SQLINTEGER *pcbSqlStr);
1890 SQLRETURN SQL_API SQLNumParams(
1891 SQLHSTMT hstmt,
1892 SQLSMALLINT *pcpar);
1894 SQLRETURN SQL_API SQLParamOptions(
1895 SQLHSTMT hstmt,
1896 SQLULEN crow,
1897 SQLULEN *pirow);
1899 SQLRETURN SQL_API SQLPrimaryKeys(
1900 SQLHSTMT hstmt,
1901 SQLCHAR *szCatalogName,
1902 SQLSMALLINT cbCatalogName,
1903 SQLCHAR *szSchemaName,
1904 SQLSMALLINT cbSchemaName,
1905 SQLCHAR *szTableName,
1906 SQLSMALLINT cbTableName);
1908 SQLRETURN SQL_API SQLProcedureColumns(
1909 SQLHSTMT hstmt,
1910 SQLCHAR *szCatalogName,
1911 SQLSMALLINT cbCatalogName,
1912 SQLCHAR *szSchemaName,
1913 SQLSMALLINT cbSchemaName,
1914 SQLCHAR *szProcName,
1915 SQLSMALLINT cbProcName,
1916 SQLCHAR *szColumnName,
1917 SQLSMALLINT cbColumnName);
1919 SQLRETURN SQL_API SQLProcedures(
1920 SQLHSTMT hstmt,
1921 SQLCHAR *szCatalogName,
1922 SQLSMALLINT cbCatalogName,
1923 SQLCHAR *szSchemaName,
1924 SQLSMALLINT cbSchemaName,
1925 SQLCHAR *szProcName,
1926 SQLSMALLINT cbProcName);
1928 SQLRETURN SQL_API SQLSetPos(
1929 SQLHSTMT hstmt,
1930 SQLSETPOSIROW irow,
1931 SQLUSMALLINT fOption,
1932 SQLUSMALLINT fLock);
1934 SQLRETURN SQL_API SQLTablePrivileges(
1935 SQLHSTMT hstmt,
1936 SQLCHAR *szCatalogName,
1937 SQLSMALLINT cbCatalogName,
1938 SQLCHAR *szSchemaName,
1939 SQLSMALLINT cbSchemaName,
1940 SQLCHAR *szTableName,
1941 SQLSMALLINT cbTableName);
1943 SQLRETURN SQL_API SQLDrivers(
1944 SQLHENV henv,
1945 SQLUSMALLINT fDirection,
1946 SQLCHAR *szDriverDesc,
1947 SQLSMALLINT cbDriverDescMax,
1948 SQLSMALLINT *pcbDriverDesc,
1949 SQLCHAR *szDriverAttributes,
1950 SQLSMALLINT cbDrvrAttrMax,
1951 SQLSMALLINT *pcbDrvrAttr);
1953 SQLRETURN SQL_API SQLBindParameter(
1954 SQLHSTMT hstmt,
1955 SQLUSMALLINT ipar,
1956 SQLSMALLINT fParamType,
1957 SQLSMALLINT fCType,
1958 SQLSMALLINT fSqlType,
1959 SQLULEN cbColDef,
1960 SQLSMALLINT ibScale,
1961 SQLPOINTER rgbValue,
1962 SQLLEN cbValueMax,
1963 SQLLEN *pcbValue);
1965 /*---------------------------------------------------------*/
1966 /* SQLAllocHandleStd is implemented to make SQLAllocHandle */
1967 /* compatible with X/Open standard. an application should */
1968 /* not call SQLAllocHandleStd directly */
1969 /*---------------------------------------------------------*/
1970 #ifdef ODBC_STD
1971 #define SQLAllocHandle SQLAllocHandleStd
1972 #define SQLAllocEnv(phenv) SQLAllocHandleStd(SQL_HANDLE_ENV, SQL_NULL_HANDLE, phenv)
1974 /* Internal type subcodes */
1975 #define SQL_YEAR SQL_CODE_YEAR
1976 #define SQL_MONTH SQL_CODE_MONTH
1977 #define SQL_DAY SQL_CODE_DAY
1978 #define SQL_HOUR SQL_CODE_HOUR
1979 #define SQL_MINUTE SQL_CODE_MINUTE
1980 #define SQL_SECOND SQL_CODE_SECOND
1981 #define SQL_YEAR_TO_MONTH SQL_CODE_YEAR_TO_MONTH
1982 #define SQL_DAY_TO_HOUR SQL_CODE_DAY_TO_HOUR
1983 #define SQL_DAY_TO_MINUTE SQL_CODE_DAY_TO_MINUTE
1984 #define SQL_DAY_TO_SECOND SQL_CODE_DAY_TO_SECOND
1985 #define SQL_HOUR_TO_MINUTE SQL_CODE_HOUR_TO_MINUTE
1986 #define SQL_HOUR_TO_SECOND SQL_CODE_HOUR_TO_SECOND
1987 #define SQL_MINUTE_TO_SECOND SQL_CODE_MINUTE_TO_SECOND
1988 #endif /* ODBC_STD */
1990 #if (ODBCVER >= 0x0300)
1991 SQLRETURN SQL_API SQLAllocHandleStd(
1992 SQLSMALLINT fHandleType,
1993 SQLHANDLE hInput,
1994 SQLHANDLE *phOutput);
1995 #endif
1997 /* Deprecated defines from prior versions of ODBC */
1998 #define SQL_DATABASE_NAME 16 /* Use SQLGetConnectOption/SQL_CURRENT_QUALIFIER */
1999 #define SQL_FD_FETCH_PREV SQL_FD_FETCH_PRIOR
2000 #define SQL_FETCH_PREV SQL_FETCH_PRIOR
2001 #define SQL_CONCUR_TIMESTAMP SQL_CONCUR_ROWVER
2002 #define SQL_SCCO_OPT_TIMESTAMP SQL_SCCO_OPT_ROWVER
2003 #define SQL_CC_DELETE SQL_CB_DELETE
2004 #define SQL_CR_DELETE SQL_CB_DELETE
2005 #define SQL_CC_CLOSE SQL_CB_CLOSE
2006 #define SQL_CR_CLOSE SQL_CB_CLOSE
2007 #define SQL_CC_PRESERVE SQL_CB_PRESERVE
2008 #define SQL_CR_PRESERVE SQL_CB_PRESERVE
2009 /* SQL_FETCH_RESUME is not supported by 2.0+ drivers
2010 #define SQL_FETCH_RESUME 7
2012 #define SQL_SCROLL_FORWARD_ONLY 0L /*-SQL_CURSOR_FORWARD_ONLY */
2013 #define SQL_SCROLL_KEYSET_DRIVEN (-1L) /*-SQL_CURSOR_KEYSET_DRIVEN */
2014 #define SQL_SCROLL_DYNAMIC (-2L) /*-SQL_CURSOR_DYNAMIC */
2015 #define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */
2017 /* Deprecated functions from prior versions of ODBC */
2018 SQLRETURN SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */
2019 SQLHSTMT hstmt,
2020 SQLUSMALLINT fConcurrency,
2021 SQLLEN crowKeyset,
2022 SQLUSMALLINT crowRowset);
2024 /* Tracing section */
2026 #define TRACE_VERSION 1000 /* Version of trace API */
2028 #ifdef UNICODE
2029 RETCODE TraceOpenLogFile(LPWSTR,LPWSTR,DWORD); /* open a trace log file */
2030 #endif
2031 #ifdef __cplusplus
2032 RETCODE TraceCloseLogFile(); /* Request to close a trace log */
2033 #else
2034 RETCODE TraceCloseLogFile(VOID); /* Request to close a trace log */
2035 #endif
2036 VOID TraceReturn(RETCODE,RETCODE); /* Processes trace after FN is called */
2037 #ifdef __cplusplus
2038 DWORD TraceVersion(); /* Returns trace API version */
2039 #else
2040 DWORD TraceVersion(VOID); /* Returns trace API version */
2041 #endif
2043 /* Functions for Visual Studio Analyzer*/
2044 /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */
2045 #define TRACE_ON 0x00000001L
2046 #define TRACE_VS_EVENT_ON 0x00000002L
2048 RETCODE TraceVSControl(DWORD);
2050 /* the flags in ODBC_VS_ARGS */
2051 #define ODBC_VS_FLAG_UNICODE_ARG 0x00000001L /* the argument is unicode */
2052 #define ODBC_VS_FLAG_UNICODE_COR 0x00000002L /* the correlation is unicode */
2053 #define ODBC_VS_FLAG_RETCODE 0x00000004L /* RetCode field is set */
2054 #define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */
2056 typedef struct tagODBC_VS_ARGS {
2057 #ifdef GUID_DEFINED
2058 const GUID *pguidEvent; /* the GUID for event */
2059 #else
2060 const void *pguidEvent; /* the GUID for event */
2061 #endif
2062 DWORD dwFlags; /* flags for the call */
2063 union {
2064 WCHAR *wszArg;
2065 CHAR *szArg;
2066 }u1;
2067 union {
2068 WCHAR *wszCorrelation;
2069 CHAR *szCorrelation;
2070 }u2;
2071 RETCODE RetCode;
2072 } ODBC_VS_ARGS, *PODBC_VS_ARGS;
2074 VOID FireVSDebugEvent(PODBC_VS_ARGS);
2077 #ifdef __cplusplus
2079 #endif
2081 #ifndef __SQLUCODE_H
2082 #include "sqlucode.h"
2083 #endif
2085 #endif