tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / external / unixODBC / inc / odbc / sqlext.h
blob5bc9d7d80088de1695df498aa13bbcd7d7972ee8
1 /*****************************************************
2 * sqlext.h
4 * These should be consistent with the MS version.
6 *****************************************************/
7 #ifndef __SQLEXT_H
8 #define __SQLEXT_H
11 /* BEGIN - unixODBC ONLY (programs like ODBCConfig and DataManager use these) */
13 /* COLUMNS IN SQLTables() RESULT SET */
14 #define SQLTables_TABLE_CATALOG 1
15 #define SQLTables_TABLE_SCHEM 2
16 #define SQLTables_TABLE_NAME 3
17 #define SQLTables_TABLE_TYPE 4
18 #define SQLTables_REMARKS 5
20 /* COLUMNS IN SQLColumns() RESULT SET */
21 #define SQLColumns_TABLE_CAT 1
22 #define SQLColumns_TABLE_SCHEM 2
23 #define SQLColumns_TABLE_NAME 3
24 #define SQLColumns_COLUMN_NAME 4
25 #define SQLColumns_DATA_TYPE 5
26 #define SQLColumns_TYPE_NAME 6
27 #define SQLColumns_COLUMN_SIZE 7
28 #define SQLColumns_BUFFER_LENGTH 8
29 #define SQLColumns_DECIMAL_DIGITS 9
30 #define SQLColumns_NUM_PREC_RADIX 10
31 #define SQLColumns_NULLABLE 11
32 #define SQLColumns_REMARKS 12
33 #define SQLColumns_COLUMN_DEF 13
34 #define SQLColumns_SQL_DATA_TYPE 14
35 #define SQLColumns_SQL_DATETIME_SUB 15
36 #define SQLColumns_CHAR_OCTET_LENGTH 16
37 #define SQLColumns_ORDINAL_POSITION 17
38 #define SQLColumns_IS_NULLABLE 18
40 /* END - unixODBC ONLY */
42 #ifndef __SQL_H
43 #include "odbc/sql.h"
44 #endif
46 #ifdef __cplusplus
47 extern "C" { /* Assume C declarations for C++ */
48 #endif
50 /* generally useful constants */
51 #define SQL_SPEC_MAJOR 3 /* Major version of specification */
52 #define SQL_SPEC_MINOR 52 /* Minor version of specification */
53 #define SQL_SPEC_STRING "03.52" /* String constant for version */
55 #define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */
56 #define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */
58 #define SQL_MAX_OPTION_STRING_LENGTH 256
60 /* return code SQL_NO_DATA_FOUND is the same as SQL_NO_DATA */
61 #if (ODBCVER < 0x0300)
62 #define SQL_NO_DATA_FOUND 100
63 #else
64 #define SQL_NO_DATA_FOUND SQL_NO_DATA
65 #endif
67 /* an end handle type */
68 #if (ODBCVER >= 0x0300)
69 #define SQL_HANDLE_SENV 5
70 #endif /* ODBCVER >= 0x0300 */
72 /* env attribute */
73 #if (ODBCVER >= 0x0300)
74 #define SQL_ATTR_ODBC_VERSION 200
75 #define SQL_ATTR_CONNECTION_POOLING 201
76 #define SQL_ATTR_CP_MATCH 202
78 /* unixODBC additions */
79 #define SQL_ATTR_UNIXODBC_SYSPATH 65001
80 #define SQL_ATTR_UNIXODBC_VERSION 65002
81 #define SQL_ATTR_UNIXODBC_ENVATTR 65003
82 #endif /* ODBCVER >= 0x0300 */
84 #if (ODBCVER >= 0x0300)
85 /* values for SQL_ATTR_CONNECTION_POOLING */
86 #define SQL_CP_OFF 0UL
87 #define SQL_CP_ONE_PER_DRIVER 1UL
88 #define SQL_CP_ONE_PER_HENV 2UL
89 #define SQL_CP_DEFAULT SQL_CP_OFF
91 /* values for SQL_ATTR_CP_MATCH */
92 #define SQL_CP_STRICT_MATCH 0UL
93 #define SQL_CP_RELAXED_MATCH 1UL
94 #define SQL_CP_MATCH_DEFAULT SQL_CP_STRICT_MATCH
96 /* values for SQL_ATTR_ODBC_VERSION */
97 #define SQL_OV_ODBC2 2UL
98 #define SQL_OV_ODBC3 3UL
99 #endif /* ODBCVER >= 0x0300 */
101 /* connection attributes */
102 #define SQL_ACCESS_MODE 101
103 #define SQL_AUTOCOMMIT 102
104 #define SQL_LOGIN_TIMEOUT 103
105 #define SQL_OPT_TRACE 104
106 #define SQL_OPT_TRACEFILE 105
107 #define SQL_TRANSLATE_DLL 106
108 #define SQL_TRANSLATE_OPTION 107
109 #define SQL_TXN_ISOLATION 108
110 #define SQL_CURRENT_QUALIFIER 109
111 #define SQL_ODBC_CURSORS 110
112 #define SQL_QUIET_MODE 111
113 #define SQL_PACKET_SIZE 112
115 /* connection attributes with new names */
116 #if (ODBCVER >= 0x0300)
117 #define SQL_ATTR_ACCESS_MODE SQL_ACCESS_MODE
118 #define SQL_ATTR_AUTOCOMMIT SQL_AUTOCOMMIT
119 #define SQL_ATTR_CONNECTION_TIMEOUT 113
120 #define SQL_ATTR_CURRENT_CATALOG SQL_CURRENT_QUALIFIER
121 #define SQL_ATTR_DISCONNECT_BEHAVIOR 114
122 #define SQL_ATTR_ENLIST_IN_DTC 1207
123 #define SQL_ATTR_ENLIST_IN_XA 1208
124 #define SQL_ATTR_LOGIN_TIMEOUT SQL_LOGIN_TIMEOUT
125 #define SQL_ATTR_ODBC_CURSORS SQL_ODBC_CURSORS
126 #define SQL_ATTR_PACKET_SIZE SQL_PACKET_SIZE
127 #define SQL_ATTR_QUIET_MODE SQL_QUIET_MODE
128 #define SQL_ATTR_TRACE SQL_OPT_TRACE
129 #define SQL_ATTR_TRACEFILE SQL_OPT_TRACEFILE
130 #define SQL_ATTR_TRANSLATE_LIB SQL_TRANSLATE_DLL
131 #define SQL_ATTR_TRANSLATE_OPTION SQL_TRANSLATE_OPTION
132 #define SQL_ATTR_TXN_ISOLATION SQL_TXN_ISOLATION
133 #endif /* ODBCVER >= 0x0300 */
135 #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */
137 #define SQL_ATTR_DRIVER_THREADING 1028 /* Driver threading level */
139 #if (ODBCVER >= 0x0351)
140 /* ODBC Driver Manager sets this connection attribute to a unicode driver
141 (which supports SQLConnectW) when the application is an ANSI application
142 (which calls SQLConnect, SQLDriverConnect, or SQLBrowseConnect).
143 This is SetConnectAttr only and application does not set this attribute
144 This attribute was introduced because some unicode driver's some APIs may
145 need to behave differently on ANSI or Unicode applications. A unicode
146 driver, which has same behavior for both ANSI or Unicode applications,
147 should return SQL_ERROR when the driver manager sets this connection
148 attribute. When a unicode driver returns SQL_SUCCESS on this attribute,
149 the driver manager treates ANSI and Unicode connections differently in
150 connection pooling.
152 #define SQL_ATTR_ANSI_APP 115
153 #endif
155 /* SQL_CONNECT_OPT_DRVR_START is not meaningful for 3.0 driver */
156 #if (ODBCVER < 0x0300)
157 #define SQL_CONNECT_OPT_DRVR_START 1000
158 #endif /* ODBCVER < 0x0300 */
160 #if (ODBCVER < 0x0300)
161 #define SQL_CONN_OPT_MAX SQL_PACKET_SIZE
162 #define SQL_CONN_OPT_MIN SQL_ACCESS_MODE
163 #endif /* ODBCVER < 0x0300 */
165 /* SQL_ACCESS_MODE options */
166 #define SQL_MODE_READ_WRITE 0UL
167 #define SQL_MODE_READ_ONLY 1UL
168 #define SQL_MODE_DEFAULT SQL_MODE_READ_WRITE
170 /* SQL_AUTOCOMMIT options */
171 #define SQL_AUTOCOMMIT_OFF 0UL
172 #define SQL_AUTOCOMMIT_ON 1UL
173 #define SQL_AUTOCOMMIT_DEFAULT SQL_AUTOCOMMIT_ON
175 /* SQL_LOGIN_TIMEOUT options */
176 #define SQL_LOGIN_TIMEOUT_DEFAULT 15UL
178 /* SQL_OPT_TRACE options */
179 #define SQL_OPT_TRACE_OFF 0UL
180 #define SQL_OPT_TRACE_ON 1UL
181 #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF
182 #define SQL_OPT_TRACE_FILE_DEFAULT "/tmp/SQL.LOG"
184 /* SQL_ODBC_CURSORS options */
185 #define SQL_CUR_USE_IF_NEEDED 0UL
186 #define SQL_CUR_USE_ODBC 1UL
187 #define SQL_CUR_USE_DRIVER 2UL
188 #define SQL_CUR_DEFAULT SQL_CUR_USE_DRIVER
190 #if (ODBCVER >= 0x0300)
191 /* values for SQL_ATTR_DISCONNECT_BEHAVIOR */
192 #define SQL_DB_RETURN_TO_POOL 0UL
193 #define SQL_DB_DISCONNECT 1UL
194 #define SQL_DB_DEFAULT SQL_DB_RETURN_TO_POOL
196 /* values for SQL_ATTR_ENLIST_IN_DTC */
197 #define SQL_DTC_DONE 0L
198 #endif /* ODBCVER >= 0x0300 */
200 /* values for SQL_ATTR_CONNECTION_DEAD */
201 #define SQL_CD_TRUE 1L /* Connection is closed/dead */
202 #define SQL_CD_FALSE 0L /* Connection is open/available */
204 /* values for SQL_ATTR_ANSI_APP */
205 #if (ODBCVER >= 0x0351)
206 #define SQL_AA_TRUE 1L /* the application is an ANSI app */
207 #define SQL_AA_FALSE 0L /* the application is a Unicode app */
208 #endif
210 /* statement attributes */
211 #define SQL_QUERY_TIMEOUT 0
212 #define SQL_MAX_ROWS 1
213 #define SQL_NOSCAN 2
214 #define SQL_MAX_LENGTH 3
215 #define SQL_ASYNC_ENABLE 4 /* same as SQL_ATTR_ASYNC_ENABLE */
216 #define SQL_BIND_TYPE 5
217 #define SQL_CURSOR_TYPE 6
218 #define SQL_CONCURRENCY 7
219 #define SQL_KEYSET_SIZE 8
220 #define SQL_ROWSET_SIZE 9
221 #define SQL_SIMULATE_CURSOR 10
222 #define SQL_RETRIEVE_DATA 11
223 #define SQL_USE_BOOKMARKS 12
224 #define SQL_GET_BOOKMARK 13 /* GetStmtOption Only */
225 #define SQL_ROW_NUMBER 14 /* GetStmtOption Only */
227 /* statement attributes for ODBC 3.0 */
228 #if (ODBCVER >= 0x0300)
229 #define SQL_ATTR_ASYNC_ENABLE 4
230 #define SQL_ATTR_CONCURRENCY SQL_CONCURRENCY
231 #define SQL_ATTR_CURSOR_TYPE SQL_CURSOR_TYPE
232 #define SQL_ATTR_ENABLE_AUTO_IPD 15
233 #define SQL_ATTR_FETCH_BOOKMARK_PTR 16
234 #define SQL_ATTR_KEYSET_SIZE SQL_KEYSET_SIZE
235 #define SQL_ATTR_MAX_LENGTH SQL_MAX_LENGTH
236 #define SQL_ATTR_MAX_ROWS SQL_MAX_ROWS
237 #define SQL_ATTR_NOSCAN SQL_NOSCAN
238 #define SQL_ATTR_PARAM_BIND_OFFSET_PTR 17
239 #define SQL_ATTR_PARAM_BIND_TYPE 18
240 #define SQL_ATTR_PARAM_OPERATION_PTR 19
241 #define SQL_ATTR_PARAM_STATUS_PTR 20
242 #define SQL_ATTR_PARAMS_PROCESSED_PTR 21
243 #define SQL_ATTR_PARAMSET_SIZE 22
244 #define SQL_ATTR_QUERY_TIMEOUT SQL_QUERY_TIMEOUT
245 #define SQL_ATTR_RETRIEVE_DATA SQL_RETRIEVE_DATA
246 #define SQL_ATTR_ROW_BIND_OFFSET_PTR 23
247 #define SQL_ATTR_ROW_BIND_TYPE SQL_BIND_TYPE
248 #define SQL_ATTR_ROW_NUMBER SQL_ROW_NUMBER /*GetStmtAttr*/
249 #define SQL_ATTR_ROW_OPERATION_PTR 24
250 #define SQL_ATTR_ROW_STATUS_PTR 25
251 #define SQL_ATTR_ROWS_FETCHED_PTR 26
252 #define SQL_ATTR_ROW_ARRAY_SIZE 27
253 #define SQL_ATTR_SIMULATE_CURSOR SQL_SIMULATE_CURSOR
254 #define SQL_ATTR_USE_BOOKMARKS SQL_USE_BOOKMARKS
256 #endif /* ODBCVER >= 0x0300 */
258 #if (ODBCVER < 0x0300)
259 #define SQL_STMT_OPT_MAX SQL_ROW_NUMBER
260 #define SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT
261 #endif /* ODBCVER < 0x0300 */
263 /* New defines for SEARCHABLE column in SQLGetTypeInfo */
265 #if (ODBCVER >= 0x0300)
266 #define SQL_COL_PRED_CHAR SQL_LIKE_ONLY
267 #define SQL_COL_PRED_BASIC SQL_ALL_EXCEPT_LIKE
268 #endif /* ODBCVER >= 0x0300 */
272 /* whether an attribute is a pointer or not */
273 #if (ODBCVER >= 0x0300)
274 #define SQL_IS_POINTER (-4)
275 #define SQL_IS_UINTEGER (-5)
276 #define SQL_IS_INTEGER (-6)
277 #define SQL_IS_USMALLINT (-7)
278 #define SQL_IS_SMALLINT (-8)
279 #endif /* ODBCVER >= 0x0300 */
281 /* the value of SQL_ATTR_PARAM_BIND_TYPE */
282 #if (ODBCVER >= 0x0300)
283 #define SQL_PARAM_BIND_BY_COLUMN 0UL
284 #define SQL_PARAM_BIND_TYPE_DEFAULT SQL_PARAM_BIND_BY_COLUMN
285 #endif /* ODBCVER >= 0x0300 */
287 /* SQL_QUERY_TIMEOUT options */
288 #define SQL_QUERY_TIMEOUT_DEFAULT 0UL
290 /* SQL_MAX_ROWS options */
291 #define SQL_MAX_ROWS_DEFAULT 0UL
293 /* SQL_NOSCAN options */
294 #define SQL_NOSCAN_OFF 0UL /* 1.0 FALSE */
295 #define SQL_NOSCAN_ON 1UL /* 1.0 TRUE */
296 #define SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF
298 /* SQL_MAX_LENGTH options */
299 #define SQL_MAX_LENGTH_DEFAULT 0UL
301 /* values for SQL_ATTR_ASYNC_ENABLE */
302 #define SQL_ASYNC_ENABLE_OFF 0UL
303 #define SQL_ASYNC_ENABLE_ON 1UL
304 #define SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF
306 /* SQL_BIND_TYPE options */
307 #define SQL_BIND_BY_COLUMN 0UL
308 #define SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN /* Default value */
310 /* SQL_CONCURRENCY options */
311 #define SQL_CONCUR_READ_ONLY 1
312 #define SQL_CONCUR_LOCK 2
313 #define SQL_CONCUR_ROWVER 3
314 #define SQL_CONCUR_VALUES 4
315 #define SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY /* Default value */
317 /* SQL_CURSOR_TYPE options */
318 #define SQL_CURSOR_FORWARD_ONLY 0UL
319 #define SQL_CURSOR_KEYSET_DRIVEN 1UL
320 #define SQL_CURSOR_DYNAMIC 2UL
321 #define SQL_CURSOR_STATIC 3UL
322 #define SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY /* Default value */
324 /* SQL_ROWSET_SIZE options */
325 #define SQL_ROWSET_SIZE_DEFAULT 1UL
327 /* SQL_KEYSET_SIZE options */
328 #define SQL_KEYSET_SIZE_DEFAULT 0UL
330 /* SQL_SIMULATE_CURSOR options */
331 #define SQL_SC_NON_UNIQUE 0UL
332 #define SQL_SC_TRY_UNIQUE 1UL
333 #define SQL_SC_UNIQUE 2UL
335 /* SQL_RETRIEVE_DATA options */
336 #define SQL_RD_OFF 0UL
337 #define SQL_RD_ON 1UL
338 #define SQL_RD_DEFAULT SQL_RD_ON
340 /* SQL_USE_BOOKMARKS options */
341 #define SQL_UB_OFF 0UL
342 #define SQL_UB_ON 01UL
343 #define SQL_UB_DEFAULT SQL_UB_OFF
345 /* New values for SQL_USE_BOOKMARKS attribute */
346 #if (ODBCVER >= 0x0300)
347 #define SQL_UB_FIXED SQL_UB_ON
348 #define SQL_UB_VARIABLE 2UL
349 #endif /* ODBCVER >= 0x0300 */
351 /* extended descriptor field */
352 #if (ODBCVER >= 0x0300)
353 #define SQL_DESC_ARRAY_SIZE 20
354 #define SQL_DESC_ARRAY_STATUS_PTR 21
355 #define SQL_DESC_AUTO_UNIQUE_VALUE SQL_COLUMN_AUTO_INCREMENT
356 #define SQL_DESC_BASE_COLUMN_NAME 22
357 #define SQL_DESC_BASE_TABLE_NAME 23
358 #define SQL_DESC_BIND_OFFSET_PTR 24
359 #define SQL_DESC_BIND_TYPE 25
360 #define SQL_DESC_CASE_SENSITIVE SQL_COLUMN_CASE_SENSITIVE
361 #define SQL_DESC_CATALOG_NAME SQL_COLUMN_QUALIFIER_NAME
362 #define SQL_DESC_CONCISE_TYPE SQL_COLUMN_TYPE
363 #define SQL_DESC_DATETIME_INTERVAL_PRECISION 26
364 #define SQL_DESC_DISPLAY_SIZE SQL_COLUMN_DISPLAY_SIZE
365 #define SQL_DESC_FIXED_PREC_SCALE SQL_COLUMN_MONEY
366 #define SQL_DESC_LABEL SQL_COLUMN_LABEL
367 #define SQL_DESC_LITERAL_PREFIX 27
368 #define SQL_DESC_LITERAL_SUFFIX 28
369 #define SQL_DESC_LOCAL_TYPE_NAME 29
370 #define SQL_DESC_MAXIMUM_SCALE 30
371 #define SQL_DESC_MINIMUM_SCALE 31
372 #define SQL_DESC_NUM_PREC_RADIX 32
373 #define SQL_DESC_PARAMETER_TYPE 33
374 #define SQL_DESC_ROWS_PROCESSED_PTR 34
375 #if (ODBCVER >= 0x0350)
376 #define SQL_DESC_ROWVER 35
377 #endif /* ODBCVER >= 0x0350 */
378 #define SQL_DESC_SCHEMA_NAME SQL_COLUMN_OWNER_NAME
379 #define SQL_DESC_SEARCHABLE SQL_COLUMN_SEARCHABLE
380 #define SQL_DESC_TYPE_NAME SQL_COLUMN_TYPE_NAME
381 #define SQL_DESC_TABLE_NAME SQL_COLUMN_TABLE_NAME
382 #define SQL_DESC_UNSIGNED SQL_COLUMN_UNSIGNED
383 #define SQL_DESC_UPDATABLE SQL_COLUMN_UPDATABLE
384 #endif /* ODBCVER >= 0x0300 */
387 /* defines for diagnostics fields */
388 #if (ODBCVER >= 0x0300)
389 #define SQL_DIAG_CURSOR_ROW_COUNT (-1249)
390 #define SQL_DIAG_ROW_NUMBER (-1248)
391 #define SQL_DIAG_COLUMN_NUMBER (-1247)
392 #endif /* ODBCVER >= 0x0300 */
394 /* SQL extended datatypes */
395 #define SQL_DATE 9
396 #if (ODBCVER >= 0x0300)
397 #define SQL_INTERVAL 10
398 #endif /* ODBCVER >= 0x0300 */
399 #define SQL_TIME 10
400 #define SQL_TIMESTAMP 11
401 #define SQL_LONGVARCHAR (-1)
402 #define SQL_BINARY (-2)
403 #define SQL_VARBINARY (-3)
404 #define SQL_LONGVARBINARY (-4)
405 #define SQL_BIGINT (-5)
406 #define SQL_TINYINT (-6)
407 #define SQL_BIT (-7)
408 #if (ODBCVER >= 0x0350)
409 #define SQL_GUID (-11)
410 #endif /* ODBCVER >= 0x0350 */
412 #if (ODBCVER >= 0x0300)
413 /* interval code */
414 #define SQL_CODE_YEAR 1
415 #define SQL_CODE_MONTH 2
416 #define SQL_CODE_DAY 3
417 #define SQL_CODE_HOUR 4
418 #define SQL_CODE_MINUTE 5
419 #define SQL_CODE_SECOND 6
420 #define SQL_CODE_YEAR_TO_MONTH 7
421 #define SQL_CODE_DAY_TO_HOUR 8
422 #define SQL_CODE_DAY_TO_MINUTE 9
423 #define SQL_CODE_DAY_TO_SECOND 10
424 #define SQL_CODE_HOUR_TO_MINUTE 11
425 #define SQL_CODE_HOUR_TO_SECOND 12
426 #define SQL_CODE_MINUTE_TO_SECOND 13
428 #define SQL_INTERVAL_YEAR (100 + SQL_CODE_YEAR)
429 #define SQL_INTERVAL_MONTH (100 + SQL_CODE_MONTH)
430 #define SQL_INTERVAL_DAY (100 + SQL_CODE_DAY)
431 #define SQL_INTERVAL_HOUR (100 + SQL_CODE_HOUR)
432 #define SQL_INTERVAL_MINUTE (100 + SQL_CODE_MINUTE)
433 #define SQL_INTERVAL_SECOND (100 + SQL_CODE_SECOND)
434 #define SQL_INTERVAL_YEAR_TO_MONTH (100 + SQL_CODE_YEAR_TO_MONTH)
435 #define SQL_INTERVAL_DAY_TO_HOUR (100 + SQL_CODE_DAY_TO_HOUR)
436 #define SQL_INTERVAL_DAY_TO_MINUTE (100 + SQL_CODE_DAY_TO_MINUTE)
437 #define SQL_INTERVAL_DAY_TO_SECOND (100 + SQL_CODE_DAY_TO_SECOND)
438 #define SQL_INTERVAL_HOUR_TO_MINUTE (100 + SQL_CODE_HOUR_TO_MINUTE)
439 #define SQL_INTERVAL_HOUR_TO_SECOND (100 + SQL_CODE_HOUR_TO_SECOND)
440 #define SQL_INTERVAL_MINUTE_TO_SECOND (100 + SQL_CODE_MINUTE_TO_SECOND)
442 #else
443 #define SQL_INTERVAL_YEAR (-80)
444 #define SQL_INTERVAL_MONTH (-81)
445 #define SQL_INTERVAL_YEAR_TO_MONTH (-82)
446 #define SQL_INTERVAL_DAY (-83)
447 #define SQL_INTERVAL_HOUR (-84)
448 #define SQL_INTERVAL_MINUTE (-85)
449 #define SQL_INTERVAL_SECOND (-86)
450 #define SQL_INTERVAL_DAY_TO_HOUR (-87)
451 #define SQL_INTERVAL_DAY_TO_MINUTE (-88)
452 #define SQL_INTERVAL_DAY_TO_SECOND (-89)
453 #define SQL_INTERVAL_HOUR_TO_MINUTE (-90)
454 #define SQL_INTERVAL_HOUR_TO_SECOND (-91)
455 #define SQL_INTERVAL_MINUTE_TO_SECOND (-92)
456 #endif /* ODBCVER >= 0x0300 */
459 #if (ODBCVER <= 0x0300)
460 #define SQL_UNICODE (-95)
461 #define SQL_UNICODE_VARCHAR (-96)
462 #define SQL_UNICODE_LONGVARCHAR (-97)
463 #define SQL_UNICODE_CHAR SQL_UNICODE
464 #else
465 /* The previous definitions for SQL_UNICODE_ are historical and obsolete */
467 #define SQL_UNICODE SQL_WCHAR
468 #define SQL_UNICODE_VARCHAR SQL_WVARCHAR
469 #define SQL_UNICODE_LONGVARCHAR SQL_WLONGVARCHAR
470 #define SQL_UNICODE_CHAR SQL_WCHAR
471 #endif
473 #if (ODBCVER < 0x0300)
474 #define SQL_TYPE_DRIVER_START SQL_INTERVAL_YEAR
475 #define SQL_TYPE_DRIVER_END SQL_UNICODE_LONGVARCHAR
476 #endif /* ODBCVER < 0x0300 */
478 /* C datatype to SQL datatype mapping SQL types
479 ------------------- */
480 #define SQL_C_CHAR SQL_CHAR /* CHAR, VARCHAR, DECIMAL, NUMERIC */
481 #define SQL_C_LONG SQL_INTEGER /* INTEGER */
482 #define SQL_C_SHORT SQL_SMALLINT /* SMALLINT */
483 #define SQL_C_FLOAT SQL_REAL /* REAL */
484 #define SQL_C_DOUBLE SQL_DOUBLE /* FLOAT, DOUBLE */
485 #if (ODBCVER >= 0x0300)
486 #define SQL_C_NUMERIC SQL_NUMERIC
487 #endif /* ODBCVER >= 0x0300 */
488 #define SQL_C_DEFAULT 99
490 #define SQL_SIGNED_OFFSET (-20)
491 #define SQL_UNSIGNED_OFFSET (-22)
493 /* C datatype to SQL datatype mapping */
494 #define SQL_C_DATE SQL_DATE
495 #define SQL_C_TIME SQL_TIME
496 #define SQL_C_TIMESTAMP SQL_TIMESTAMP
497 #if (ODBCVER >= 0x0300)
498 #define SQL_C_TYPE_DATE SQL_TYPE_DATE
499 #define SQL_C_TYPE_TIME SQL_TYPE_TIME
500 #define SQL_C_TYPE_TIMESTAMP SQL_TYPE_TIMESTAMP
501 #define SQL_C_INTERVAL_YEAR SQL_INTERVAL_YEAR
502 #define SQL_C_INTERVAL_MONTH SQL_INTERVAL_MONTH
503 #define SQL_C_INTERVAL_DAY SQL_INTERVAL_DAY
504 #define SQL_C_INTERVAL_HOUR SQL_INTERVAL_HOUR
505 #define SQL_C_INTERVAL_MINUTE SQL_INTERVAL_MINUTE
506 #define SQL_C_INTERVAL_SECOND SQL_INTERVAL_SECOND
507 #define SQL_C_INTERVAL_YEAR_TO_MONTH SQL_INTERVAL_YEAR_TO_MONTH
508 #define SQL_C_INTERVAL_DAY_TO_HOUR SQL_INTERVAL_DAY_TO_HOUR
509 #define SQL_C_INTERVAL_DAY_TO_MINUTE SQL_INTERVAL_DAY_TO_MINUTE
510 #define SQL_C_INTERVAL_DAY_TO_SECOND SQL_INTERVAL_DAY_TO_SECOND
511 #define SQL_C_INTERVAL_HOUR_TO_MINUTE SQL_INTERVAL_HOUR_TO_MINUTE
512 #define SQL_C_INTERVAL_HOUR_TO_SECOND SQL_INTERVAL_HOUR_TO_SECOND
513 #define SQL_C_INTERVAL_MINUTE_TO_SECOND SQL_INTERVAL_MINUTE_TO_SECOND
514 #endif /* ODBCVER >= 0x0300 */
515 #define SQL_C_BINARY SQL_BINARY
516 #define SQL_C_BIT SQL_BIT
517 #if (ODBCVER >= 0x0300)
518 #define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */
519 #define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */
520 #endif /* ODBCVER >= 0x0300 */
521 #define SQL_C_TINYINT SQL_TINYINT
522 #define SQL_C_SLONG (SQL_C_LONG+SQL_SIGNED_OFFSET) /* SIGNED INTEGER */
523 #define SQL_C_SSHORT (SQL_C_SHORT+SQL_SIGNED_OFFSET) /* SIGNED SMALLINT */
524 #define SQL_C_STINYINT (SQL_TINYINT+SQL_SIGNED_OFFSET) /* SIGNED TINYINT */
525 #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/
526 #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/
527 #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/
529 #if (ODBCVER >= 0x0300) && (SIZEOF_LONG_INT == 8) && !defined(BUILD_LEGACY_64_BIT_MODE)
530 #define SQL_C_BOOKMARK SQL_C_UBIGINT /* BOOKMARK */
531 #else
532 #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */
533 #endif
535 #if (ODBCVER >= 0x0350)
536 #define SQL_C_GUID SQL_GUID
537 #endif /* ODBCVER >= 0x0350 */
539 #define SQL_TYPE_NULL 0
540 #if (ODBCVER < 0x0300)
541 #define SQL_TYPE_MIN SQL_BIT
542 #define SQL_TYPE_MAX SQL_VARCHAR
543 #endif
545 #if (ODBCVER >= 0x0300)
546 #define SQL_C_VARBOOKMARK SQL_C_BINARY
547 #endif /* ODBCVER >= 0x0300 */
549 /* define for SQL_DIAG_ROW_NUMBER and SQL_DIAG_COLUMN_NUMBER */
550 #if (ODBCVER >= 0x0300)
551 #define SQL_NO_ROW_NUMBER (-1)
552 #define SQL_NO_COLUMN_NUMBER (-1)
553 #define SQL_ROW_NUMBER_UNKNOWN (-2)
554 #define SQL_COLUMN_NUMBER_UNKNOWN (-2)
555 #endif
557 /* SQLBindParameter extensions */
558 #define SQL_DEFAULT_PARAM (-5)
559 #define SQL_IGNORE (-6)
560 #if (ODBCVER >= 0x0300)
561 #define SQL_COLUMN_IGNORE SQL_IGNORE
562 #endif /* ODBCVER >= 0x0300 */
563 #define SQL_LEN_DATA_AT_EXEC_OFFSET (-100)
564 #define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)
566 /* binary length for driver specific attributes */
567 #define SQL_LEN_BINARY_ATTR_OFFSET (-100)
568 #define SQL_LEN_BINARY_ATTR(length) (-(length)+SQL_LEN_BINARY_ATTR_OFFSET)
570 /* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter
572 #define SQL_PARAM_TYPE_DEFAULT SQL_PARAM_INPUT_OUTPUT
573 #define SQL_SETPARAM_VALUE_MAX (-1L)
575 /* SQLColAttributes defines */
576 #define SQL_COLUMN_COUNT 0
577 #define SQL_COLUMN_NAME 1
578 #define SQL_COLUMN_TYPE 2
579 #define SQL_COLUMN_LENGTH 3
580 #define SQL_COLUMN_PRECISION 4
581 #define SQL_COLUMN_SCALE 5
582 #define SQL_COLUMN_DISPLAY_SIZE 6
583 #define SQL_COLUMN_NULLABLE 7
584 #define SQL_COLUMN_UNSIGNED 8
585 #define SQL_COLUMN_MONEY 9
586 #define SQL_COLUMN_UPDATABLE 10
587 #define SQL_COLUMN_AUTO_INCREMENT 11
588 #define SQL_COLUMN_CASE_SENSITIVE 12
589 #define SQL_COLUMN_SEARCHABLE 13
590 #define SQL_COLUMN_TYPE_NAME 14
591 #define SQL_COLUMN_TABLE_NAME 15
592 #define SQL_COLUMN_OWNER_NAME 16
593 #define SQL_COLUMN_QUALIFIER_NAME 17
594 #define SQL_COLUMN_LABEL 18
595 #define SQL_COLATT_OPT_MAX SQL_COLUMN_LABEL
596 #if (ODBCVER < 0x0300)
597 #define SQL_COLUMN_DRIVER_START 1000
598 #endif /* ODBCVER < 0x0300 */
600 #define SQL_COLATT_OPT_MIN SQL_COLUMN_COUNT
602 /* SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE */
603 #define SQL_ATTR_READONLY 0
604 #define SQL_ATTR_WRITE 1
605 #define SQL_ATTR_READWRITE_UNKNOWN 2
607 /* SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE */
608 /* These are also used by SQLGetInfo */
609 #define SQL_UNSEARCHABLE 0
610 #define SQL_LIKE_ONLY 1
611 #define SQL_ALL_EXCEPT_LIKE 2
612 #define SQL_SEARCHABLE 3
613 #define SQL_PRED_SEARCHABLE SQL_SEARCHABLE
616 /* Special return values for SQLGetData */
617 #define SQL_NO_TOTAL (-4)
619 /********************************************/
620 /* SQLGetFunctions: additional values for */
621 /* Function to represent functions that */
622 /* are not in the X/Open spec. */
623 /********************************************/
625 #if (ODBCVER >= 0x0300)
626 #define SQL_API_SQLALLOCHANDLESTD 73
627 #define SQL_API_SQLBULKOPERATIONS 24
628 #endif /* ODBCVER >= 0x0300 */
629 #define SQL_API_SQLBINDPARAMETER 72
630 #define SQL_API_SQLBROWSECONNECT 55
631 #define SQL_API_SQLCOLATTRIBUTES 6
632 #define SQL_API_SQLCOLUMNPRIVILEGES 56
633 #define SQL_API_SQLDESCRIBEPARAM 58
634 #define SQL_API_SQLDRIVERCONNECT 41
635 #define SQL_API_SQLDRIVERS 71
636 #define SQL_API_SQLEXTENDEDFETCH 59
637 #define SQL_API_SQLFOREIGNKEYS 60
638 #define SQL_API_SQLMORERESULTS 61
639 #define SQL_API_SQLNATIVESQL 62
640 #define SQL_API_SQLNUMPARAMS 63
641 #define SQL_API_SQLPARAMOPTIONS 64
642 #define SQL_API_SQLPRIMARYKEYS 65
643 #define SQL_API_SQLPROCEDURECOLUMNS 66
644 #define SQL_API_SQLPROCEDURES 67
645 #define SQL_API_SQLSETPOS 68
646 #define SQL_API_SQLSETSCROLLOPTIONS 69
647 #define SQL_API_SQLTABLEPRIVILEGES 70
649 /*-------------------------------------------*/
650 /* SQL_EXT_API_LAST is not useful with ODBC */
651 /* version 3.0 because some of the values */
652 /* from X/Open are in the 10000 range. */
653 /*-------------------------------------------*/
655 #if (ODBCVER < 0x0300)
656 #define SQL_EXT_API_LAST SQL_API_SQLBINDPARAMETER
657 #define SQL_NUM_FUNCTIONS 23
658 #define SQL_EXT_API_START 40
659 #define SQL_NUM_EXTENSIONS (SQL_EXT_API_LAST-SQL_EXT_API_START+1)
660 #endif
662 /*--------------------------------------------*/
663 /* SQL_API_ALL_FUNCTIONS returns an array */
664 /* of 'booleans' representing whether a */
665 /* function is implemented by the driver. */
666 /* */
667 /* CAUTION: Only functions defined in ODBC */
668 /* version 2.0 and earlier are returned, the */
669 /* new high-range function numbers defined by */
670 /* X/Open break this scheme. See the new */
671 /* method -- SQL_API_ODBC3_ALL_FUNCTIONS */
672 /*--------------------------------------------*/
674 #define SQL_API_ALL_FUNCTIONS 0 /* See CAUTION above */
676 /*----------------------------------------------*/
677 /* 2.X drivers export a dummy function with */
678 /* ordinal number SQL_API_LOADBYORDINAL to speed*/
679 /* loading under the windows operating system. */
680 /* */
681 /* CAUTION: Loading by ordinal is not supported */
682 /* for 3.0 and above drivers. */
683 /*----------------------------------------------*/
685 #define SQL_API_LOADBYORDINAL 199 /* See CAUTION above */
687 /*----------------------------------------------*/
688 /* SQL_API_ODBC3_ALL_FUNCTIONS */
689 /* This returns a bitmap, which allows us to */
690 /* handle the higher-valued function numbers. */
691 /* Use SQL_FUNC_EXISTS(bitmap,function_number) */
692 /* to determine if the function exists. */
693 /*----------------------------------------------*/
696 #if (ODBCVER >= 0x0300)
697 #define SQL_API_ODBC3_ALL_FUNCTIONS 999
698 #define SQL_API_ODBC3_ALL_FUNCTIONS_SIZE 250 /* array of 250 words */
701 #define SQL_FUNC_EXISTS(pfExists, uwAPI) ((*(((UWORD*) (pfExists)) + ((uwAPI) >> 4)) & (1 << ((uwAPI) & 0x000F)) ) ? SQL_TRUE : SQL_FALSE )
703 #endif /* ODBCVER >= 0x0300 */
706 /************************************************/
707 /* Extended definitions for SQLGetInfo */
708 /************************************************/
710 /*---------------------------------*/
711 /* Values in ODBC 2.0 that are not */
712 /* in the X/Open spec */
713 /*---------------------------------*/
715 #define SQL_INFO_FIRST 0
716 #define SQL_ACTIVE_CONNECTIONS 0 /* MAX_DRIVER_CONNECTIONS */
717 #define SQL_ACTIVE_STATEMENTS 1 /* MAX_CONCURRENT_ACTIVITIES */
718 #define SQL_DRIVER_HDBC 3
719 #define SQL_DRIVER_HENV 4
720 #define SQL_DRIVER_HSTMT 5
721 #define SQL_DRIVER_NAME 6
722 #define SQL_DRIVER_VER 7
723 #define SQL_ODBC_API_CONFORMANCE 9
724 #define SQL_ODBC_VER 10
725 #define SQL_ROW_UPDATES 11
726 #define SQL_ODBC_SAG_CLI_CONFORMANCE 12
727 #define SQL_ODBC_SQL_CONFORMANCE 15
728 #define SQL_PROCEDURES 21
729 #define SQL_CONCAT_NULL_BEHAVIOR 22
730 #define SQL_CURSOR_ROLLBACK_BEHAVIOR 24
731 #define SQL_EXPRESSIONS_IN_ORDERBY 27
732 #define SQL_MAX_OWNER_NAME_LEN 32 /* MAX_SCHEMA_NAME_LEN */
733 #define SQL_MAX_PROCEDURE_NAME_LEN 33
734 #define SQL_MAX_QUALIFIER_NAME_LEN 34 /* MAX_CATALOG_NAME_LEN */
735 #define SQL_MULT_RESULT_SETS 36
736 #define SQL_MULTIPLE_ACTIVE_TXN 37
737 #define SQL_OUTER_JOINS 38
738 #define SQL_OWNER_TERM 39
739 #define SQL_PROCEDURE_TERM 40
740 #define SQL_QUALIFIER_NAME_SEPARATOR 41
741 #define SQL_QUALIFIER_TERM 42
742 #define SQL_SCROLL_OPTIONS 44
743 #define SQL_TABLE_TERM 45
744 #define SQL_CONVERT_FUNCTIONS 48
745 #define SQL_NUMERIC_FUNCTIONS 49
746 #define SQL_STRING_FUNCTIONS 50
747 #define SQL_SYSTEM_FUNCTIONS 51
748 #define SQL_TIMEDATE_FUNCTIONS 52
749 #define SQL_CONVERT_BIGINT 53
750 #define SQL_CONVERT_BINARY 54
751 #define SQL_CONVERT_BIT 55
752 #define SQL_CONVERT_CHAR 56
753 #define SQL_CONVERT_DATE 57
754 #define SQL_CONVERT_DECIMAL 58
755 #define SQL_CONVERT_DOUBLE 59
756 #define SQL_CONVERT_FLOAT 60
757 #define SQL_CONVERT_INTEGER 61
758 #define SQL_CONVERT_LONGVARCHAR 62
759 #define SQL_CONVERT_NUMERIC 63
760 #define SQL_CONVERT_REAL 64
761 #define SQL_CONVERT_SMALLINT 65
762 #define SQL_CONVERT_TIME 66
763 #define SQL_CONVERT_TIMESTAMP 67
764 #define SQL_CONVERT_TINYINT 68
765 #define SQL_CONVERT_VARBINARY 69
766 #define SQL_CONVERT_VARCHAR 70
767 #define SQL_CONVERT_LONGVARBINARY 71
768 #define SQL_CONVERT_GUID 173
769 #define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */
770 #define SQL_CORRELATION_NAME 74
771 #define SQL_NON_NULLABLE_COLUMNS 75
772 #define SQL_DRIVER_HLIB 76
773 #define SQL_DRIVER_ODBC_VER 77
774 #define SQL_LOCK_TYPES 78
775 #define SQL_POS_OPERATIONS 79
776 #define SQL_POSITIONED_STATEMENTS 80
777 #define SQL_BOOKMARK_PERSISTENCE 82
778 #define SQL_STATIC_SENSITIVITY 83
779 #define SQL_FILE_USAGE 84
780 #define SQL_COLUMN_ALIAS 87
781 #define SQL_GROUP_BY 88
782 #define SQL_KEYWORDS 89
783 #define SQL_OWNER_USAGE 91
784 #define SQL_QUALIFIER_USAGE 92
785 #define SQL_QUOTED_IDENTIFIER_CASE 93
786 #define SQL_SUBQUERIES 95
787 #define SQL_UNION 96
788 #define SQL_MAX_ROW_SIZE_INCLUDES_LONG 103
789 #define SQL_MAX_CHAR_LITERAL_LEN 108
790 #define SQL_TIMEDATE_ADD_INTERVALS 109
791 #define SQL_TIMEDATE_DIFF_INTERVALS 110
792 #define SQL_NEED_LONG_DATA_LEN 111
793 #define SQL_MAX_BINARY_LITERAL_LEN 112
794 #define SQL_LIKE_ESCAPE_CLAUSE 113
795 #define SQL_QUALIFIER_LOCATION 114
797 #if (ODBCVER >= 0x0201 && ODBCVER < 0x0300)
798 #ifndef SQL_OJ_CAPABILITIES
799 #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */
800 #endif
801 #endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */
803 /*----------------------------------------------*/
804 /* SQL_INFO_LAST and SQL_INFO_DRIVER_START are */
805 /* not useful anymore, because X/Open has */
806 /* values in the 10000 range. You */
807 /* must contact X/Open directly to get a range */
808 /* of numbers for driver-specific values. */
809 /*----------------------------------------------*/
811 #if (ODBCVER < 0x0300)
812 #define SQL_INFO_LAST SQL_QUALIFIER_LOCATION
813 #define SQL_INFO_DRIVER_START 1000
814 #endif /* ODBCVER < 0x0300 */
816 /*-----------------------------------------------*/
817 /* ODBC 3.0 SQLGetInfo values that are not part */
818 /* of the X/Open standard at this time. X/Open */
819 /* standard values are in sql.h. */
820 /*-----------------------------------------------*/
822 #if (ODBCVER >= 0x0300)
823 #define SQL_ACTIVE_ENVIRONMENTS 116
824 #define SQL_ALTER_DOMAIN 117
826 #define SQL_SQL_CONFORMANCE 118
827 #define SQL_DATETIME_LITERALS 119
829 #define SQL_ASYNC_MODE 10021 /* new X/Open spec */
830 #define SQL_BATCH_ROW_COUNT 120
831 #define SQL_BATCH_SUPPORT 121
832 #define SQL_CATALOG_LOCATION SQL_QUALIFIER_LOCATION
833 #define SQL_CATALOG_NAME_SEPARATOR SQL_QUALIFIER_NAME_SEPARATOR
834 #define SQL_CATALOG_TERM SQL_QUALIFIER_TERM
835 #define SQL_CATALOG_USAGE SQL_QUALIFIER_USAGE
836 #define SQL_CONVERT_WCHAR 122
837 #define SQL_CONVERT_INTERVAL_DAY_TIME 123
838 #define SQL_CONVERT_INTERVAL_YEAR_MONTH 124
839 #define SQL_CONVERT_WLONGVARCHAR 125
840 #define SQL_CONVERT_WVARCHAR 126
841 #define SQL_CREATE_ASSERTION 127
842 #define SQL_CREATE_CHARACTER_SET 128
843 #define SQL_CREATE_COLLATION 129
844 #define SQL_CREATE_DOMAIN 130
845 #define SQL_CREATE_SCHEMA 131
846 #define SQL_CREATE_TABLE 132
847 #define SQL_CREATE_TRANSLATION 133
848 #define SQL_CREATE_VIEW 134
849 #define SQL_DRIVER_HDESC 135
850 #define SQL_DROP_ASSERTION 136
851 #define SQL_DROP_CHARACTER_SET 137
852 #define SQL_DROP_COLLATION 138
853 #define SQL_DROP_DOMAIN 139
854 #define SQL_DROP_SCHEMA 140
855 #define SQL_DROP_TABLE 141
856 #define SQL_DROP_TRANSLATION 142
857 #define SQL_DROP_VIEW 143
858 #define SQL_DYNAMIC_CURSOR_ATTRIBUTES1 144
859 #define SQL_DYNAMIC_CURSOR_ATTRIBUTES2 145
860 #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 146
861 #define SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 147
862 #define SQL_INDEX_KEYWORDS 148
863 #define SQL_INFO_SCHEMA_VIEWS 149
864 #define SQL_KEYSET_CURSOR_ATTRIBUTES1 150
865 #define SQL_KEYSET_CURSOR_ATTRIBUTES2 151
866 #define SQL_MAX_ASYNC_CONCURRENT_STATEMENTS 10022 /* new X/Open spec */
867 #define SQL_ODBC_INTERFACE_CONFORMANCE 152
868 #define SQL_PARAM_ARRAY_ROW_COUNTS 153
869 #define SQL_PARAM_ARRAY_SELECTS 154
870 #define SQL_SCHEMA_TERM SQL_OWNER_TERM
871 #define SQL_SCHEMA_USAGE SQL_OWNER_USAGE
872 #define SQL_SQL92_DATETIME_FUNCTIONS 155
873 #define SQL_SQL92_FOREIGN_KEY_DELETE_RULE 156
874 #define SQL_SQL92_FOREIGN_KEY_UPDATE_RULE 157
875 #define SQL_SQL92_GRANT 158
876 #define SQL_SQL92_NUMERIC_VALUE_FUNCTIONS 159
877 #define SQL_SQL92_PREDICATES 160
878 #define SQL_SQL92_RELATIONAL_JOIN_OPERATORS 161
879 #define SQL_SQL92_REVOKE 162
880 #define SQL_SQL92_ROW_VALUE_CONSTRUCTOR 163
881 #define SQL_SQL92_STRING_FUNCTIONS 164
882 #define SQL_SQL92_VALUE_EXPRESSIONS 165
883 #define SQL_STANDARD_CLI_CONFORMANCE 166
884 #define SQL_STATIC_CURSOR_ATTRIBUTES1 167
885 #define SQL_STATIC_CURSOR_ATTRIBUTES2 168
887 #define SQL_AGGREGATE_FUNCTIONS 169
888 #define SQL_DDL_INDEX 170
889 #define SQL_DM_VER 171
890 #define SQL_INSERT_STATEMENT 172
891 #define SQL_UNION_STATEMENT SQL_UNION
892 #endif /* ODBCVER >= 0x0300 */
894 #define SQL_DTC_TRANSITION_COST 1750
896 /* SQL_ALTER_TABLE bitmasks */
897 #if (ODBCVER >= 0x0300)
898 /* the following 5 bitmasks are defined in sql.h
899 *#define SQL_AT_ADD_COLUMN 0x00000001L
900 *#define SQL_AT_DROP_COLUMN 0x00000002L
901 *#define SQL_AT_ADD_CONSTRAINT 0x00000008L
903 #define SQL_AT_ADD_COLUMN_SINGLE 0x00000020L
904 #define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L
905 #define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L
906 #define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L
907 #define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L
908 #define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L
909 #define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L
910 #define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L
911 #define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L
912 #define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L
913 #define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L
914 #define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L
915 #define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L
916 #define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L
917 #define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L
918 #endif /* ODBCVER >= 0x0300 */
920 /* SQL_CONVERT_* return value bitmasks */
922 #define SQL_CVT_CHAR 0x00000001L
923 #define SQL_CVT_NUMERIC 0x00000002L
924 #define SQL_CVT_DECIMAL 0x00000004L
925 #define SQL_CVT_INTEGER 0x00000008L
926 #define SQL_CVT_SMALLINT 0x00000010L
927 #define SQL_CVT_FLOAT 0x00000020L
928 #define SQL_CVT_REAL 0x00000040L
929 #define SQL_CVT_DOUBLE 0x00000080L
930 #define SQL_CVT_VARCHAR 0x00000100L
931 #define SQL_CVT_LONGVARCHAR 0x00000200L
932 #define SQL_CVT_BINARY 0x00000400L
933 #define SQL_CVT_VARBINARY 0x00000800L
934 #define SQL_CVT_BIT 0x00001000L
935 #define SQL_CVT_TINYINT 0x00002000L
936 #define SQL_CVT_BIGINT 0x00004000L
937 #define SQL_CVT_DATE 0x00008000L
938 #define SQL_CVT_TIME 0x00010000L
939 #define SQL_CVT_TIMESTAMP 0x00020000L
940 #define SQL_CVT_LONGVARBINARY 0x00040000L
941 #if (ODBCVER >= 0x0300)
942 #define SQL_CVT_INTERVAL_YEAR_MONTH 0x00080000L
943 #define SQL_CVT_INTERVAL_DAY_TIME 0x00100000L
944 #define SQL_CVT_WCHAR 0x00200000L
945 #define SQL_CVT_WLONGVARCHAR 0x00400000L
946 #define SQL_CVT_WVARCHAR 0x00800000L
947 #define SQL_CVT_GUID 0x01000000L
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 SQLLEN irow,
1861 SQLULEN *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);
2025 * \defgroup Tracing.
2027 * unixODBC implements a slight variation of the tracing mechanism used
2028 * on MS platforms. The unixODBC method loses the ability to produce trace
2029 * output for invalid handles but gains the following;
2031 * - better concurrency
2032 * - allows tracing to be turned on/off and configured at finer granularity
2033 * - hopefully; better performance
2035 * unixODBC provides a cross-platform helper library called 'trace' and an
2036 * example/default trace plugin called 'odbctrac'. Those writing an ODBC
2037 * driver can use the 'trace' helper library (a static library). Those wanting
2038 * to create custom trace output can implement a different version of the
2039 * 'odbctrac' plugin.
2041 * The text file driver (odbctxt) included with unixODBC is an example of a
2042 * driver using the 'trace' helper library.
2044 * The 'trace' library and the example plugin 'odbctrac' are designed to be
2045 * portable on all platforms where unixODBC is available and on MS platforms.
2046 * This will allow drivers using 'trace' and 'odbctrac' plugin to equilly
2047 * portable. On MS platforms - this compliments traditional tracing (mostly
2048 * just used by the Driver Manager).
2050 * \sa trace
2051 * odbctxt
2052 * odbctrac
2054 /*@{*/
2055 #define TRACE_VERSION 1000 /*!< Version of trace API */
2056 #ifdef UNICODE
2057 RETCODE TraceOpenLogFile(SQLPOINTER,LPWSTR,LPWSTR,DWORD); /*!< open a trace log file */
2058 #else
2059 RETCODE TraceOpenLogFile(SQLPOINTER,LPSTR,LPSTR,DWORD); /*!< open a trace log file */
2060 #endif
2061 RETCODE TraceCloseLogFile(SQLPOINTER); /*!< Request to close a trace log */
2062 SQLRETURN TraceReturn(SQLPOINTER,SQLRETURN); /*!< Call to produce trace output upon function return. */
2063 #ifdef __cplusplus
2064 DWORD TraceVersion(); /*!< Returns trace API version */
2065 #else
2066 DWORD TraceVersion(VOID); /*!< Returns trace API version */
2067 #endif
2069 /* Functions for Visual Studio Analyzer*/
2070 /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */
2071 #define TRACE_ON 0x00000001L
2072 #define TRACE_VS_EVENT_ON 0x00000002L
2074 RETCODE TraceVSControl(DWORD);
2076 /* the flags in ODBC_VS_ARGS */
2077 #define ODBC_VS_FLAG_UNICODE_ARG 0x00000001L /* the argument is unicode */
2078 #define ODBC_VS_FLAG_UNICODE_COR 0x00000002L /* the correlation is unicode */
2079 #define ODBC_VS_FLAG_RETCODE 0x00000004L /* RetCode field is set */
2080 #define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */
2082 typedef struct tagODBC_VS_ARGS {
2083 #ifdef GUID_DEFINED
2084 const GUID *pguidEvent; /* the GUID for event */
2085 #else
2086 const void *pguidEvent; /* the GUID for event */
2087 #endif
2088 DWORD dwFlags; /* flags for the call */
2089 union {
2090 WCHAR *wszArg;
2091 CHAR *szArg;
2092 }u1;
2093 union {
2094 WCHAR *wszCorrelation;
2095 CHAR *szCorrelation;
2096 }u2;
2097 RETCODE RetCode;
2098 } ODBC_VS_ARGS, *PODBC_VS_ARGS;
2100 VOID FireVSDebugEvent(PODBC_VS_ARGS);
2101 /*@}*/
2103 #ifdef __cplusplus
2105 #endif
2108 * connection pooling retry times
2111 int ODBCSetTryWaitValue ( DWORD dwValue );
2112 #ifdef __cplusplus
2113 DWORD ODBCGetTryWaitValue ( );
2114 #else
2115 DWORD ODBCGetTryWaitValue ( VOID );
2116 #endif
2118 #ifndef __SQLUCODE_H
2119 #include "odbc/sqlucode.h"
2120 #endif
2122 #endif