source: branch/egtra-stream-without-en_dec/api_sqlext.sbp@ 682

Last change on this file since 682 was 497, checked in by イグトランス (egtra), 17 years ago

インクルードガードとその他不要な前処理定義などの削除

File size: 67.8 KB
Line 
1' api_sqlext.sbp
2
3#require <api_sql.sbp>
4
5/* generally useful constants */
6Const SQL_SPEC_MAJOR = 3 /* Major version of specification */
7Const SQL_SPEC_MINOR = 52 /* Minor version of specification */
8Const SQL_SPEC_STRING = "03.52" /* String constant for version */
9
10Const SQL_SQLSTATE_SIZE = 5 /* size of SQLSTATE */
11Const SQL_MAX_DSN_LENGTH = 32 /* maximum data source name size */
12
13Const SQL_MAX_OPTION_STRING_LENGTH = 256
14
15/* return code SQL_NO_DATA_FOUND is the same as SQL_NO_DATA */
16Const SQL_NO_DATA_FOUND = SQL_NO_DATA
17
18/* an end handle type */
19Const SQL_HANDLE_SENV = 5
20
21
22/* env attribute */
23Const SQL_ATTR_ODBC_VERSION = 200
24Const SQL_ATTR_CONNECTION_POOLING = 201
25Const SQL_ATTR_CP_MATCH = 202
26
27
28/* values for SQL_ATTR_CONNECTION_POOLING */
29Const SQL_CP_OFF = 0
30Const SQL_CP_ONE_PER_DRIVER = 1
31Const SQL_CP_ONE_PER_HENV = 2
32Const SQL_CP_DEFAULT = SQL_CP_OFF
33
34/* values for SQL_ATTR_CP_MATCH */
35Const SQL_CP_STRICT_MATCH = 0
36Const SQL_CP_RELAXED_MATCH = 1
37Const SQL_CP_MATCH_DEFAULT = SQL_CP_STRICT_MATCH
38
39/* values for SQL_ATTR_ODBC_VERSION */
40Const SQL_OV_ODBC2 = 2
41Const SQL_OV_ODBC3 = 3
42
43
44/* connection attributes */
45Const SQL_ACCESS_MODE = 101
46Const SQL_AUTOCOMMIT = 102
47Const SQL_LOGIN_TIMEOUT = 103
48Const SQL_OPT_TRACE = 104
49Const SQL_OPT_TRACEFILE = 105
50Const SQL_TRANSLATE_DLL = 106
51Const SQL_TRANSLATE_OPTION = 107
52Const SQL_TXN_ISOLATION = 108
53Const SQL_CURRENT_QUALIFIER = 109
54Const SQL_ODBC_CURSORS = 110
55Const SQL_QUIET_MODE = 111
56Const SQL_PACKET_SIZE = 112
57
58/* connection attributes with new names */
59Const SQL_ATTR_ACCESS_MODE = SQL_ACCESS_MODE
60Const SQL_ATTR_AUTOCOMMIT = SQL_AUTOCOMMIT
61Const SQL_ATTR_CONNECTION_TIMEOUT = 113
62Const SQL_ATTR_CURRENT_CATALOG = SQL_CURRENT_QUALIFIER
63Const SQL_ATTR_DISCONNECT_BEHAVIOR = 114
64Const SQL_ATTR_ENLIST_IN_DTC = 1207
65Const SQL_ATTR_ENLIST_IN_XA = 1208
66Const SQL_ATTR_LOGIN_TIMEOUT = SQL_LOGIN_TIMEOUT
67Const SQL_ATTR_ODBC_CURSORS = SQL_ODBC_CURSORS
68Const SQL_ATTR_PACKET_SIZE = SQL_PACKET_SIZE
69Const SQL_ATTR_QUIET_MODE = SQL_QUIET_MODE
70Const SQL_ATTR_TRACE = SQL_OPT_TRACE
71Const SQL_ATTR_TRACEFILE = SQL_OPT_TRACEFILE
72Const SQL_ATTR_TRANSLATE_LIB = SQL_TRANSLATE_DLL
73Const SQL_ATTR_TRANSLATE_OPTION = SQL_TRANSLATE_OPTION
74Const SQL_ATTR_TXN_ISOLATION = SQL_TXN_ISOLATION
75
76
77Const SQL_ATTR_CONNECTION_DEAD = 1209 /* GetConnectAttr only */
78
79/* ODBC Driver Manager sets this connection attribute to a unicode driver
80 (which supports SQLConnectW) when the application is an ANSI application
81 (which calls SQLConnect, SQLDriverConnect, or SQLBrowseConnect).
82 This is SetConnectAttr only and application does not set this attribute
83 This attribute was introduced because some unicode driver's some APIs may
84 need to behave differently on ANSI or Unicode applications. A unicode
85 driver, which has same behavior for both ANSI or Unicode applications,
86 should return SQL_ERROR when the driver manager sets this connection
87 attribute. When a unicode driver returns SQL_SUCCESS on this attribute,
88 the driver manager treates ANSI and Unicode connections differently in
89 connection pooling.
90*/
91Const SQL_ATTR_ANSI_APP = 115
92
93
94/* SQL_ACCESS_MODE options */
95Const SQL_MODE_READ_WRITE = 0
96Const SQL_MODE_READ_ONLY = 1
97Const SQL_MODE_DEFAULT = SQL_MODE_READ_WRITE
98
99/* SQL_AUTOCOMMIT options */
100Const SQL_AUTOCOMMIT_OFF = 0
101Const SQL_AUTOCOMMIT_ON = 1
102Const SQL_AUTOCOMMIT_DEFAULT = SQL_AUTOCOMMIT_ON
103
104/* SQL_LOGIN_TIMEOUT options */
105Const SQL_LOGIN_TIMEOUT_DEFAULT = 15
106
107/* SQL_OPT_TRACE options */
108Const SQL_OPT_TRACE_OFF = 0
109Const SQL_OPT_TRACE_ON = 1
110Const SQL_OPT_TRACE_DEFAULT = SQL_OPT_TRACE_OFF
111Const SQL_OPT_TRACE_FILE_DEFAULT = "\SQL.LOG"
112
113/* SQL_ODBC_CURSORS options */
114Const SQL_CUR_USE_IF_NEEDED = 0
115Const SQL_CUR_USE_ODBC = 1
116Const SQL_CUR_USE_DRIVER = 2
117Const SQL_CUR_DEFAULT = SQL_CUR_USE_DRIVER
118
119/* values for SQL_ATTR_DISCONNECT_BEHAVIOR */
120Const SQL_DB_RETURN_TO_POOL = 0
121Const SQL_DB_DISCONNECT = 1
122Const SQL_DB_DEFAULT = SQL_DB_RETURN_TO_POOL
123
124/* values for SQL_ATTR_ENLIST_IN_DTC */
125Const SQL_DTC_DONE = 0
126
127
128/* values for SQL_ATTR_CONNECTION_DEAD */
129Const SQL_CD_TRUE = 1 /* Connection is closed/dead */
130Const SQL_CD_FALSE = 0 /* Connection is open/available */
131
132/* values for SQL_ATTR_ANSI_APP */
133Const SQL_AA_TRUE = 1 /* the application is an ANSI app */
134Const SQL_AA_FALSE = 0 /* the application is a Unicode app */
135
136/* statement attributes */
137Const SQL_QUERY_TIMEOUT = 0
138Const SQL_MAX_ROWS = 1
139Const SQL_NOSCAN = 2
140Const SQL_MAX_LENGTH = 3
141Const SQL_ASYNC_ENABLE = 4 /* same as SQL_ATTR_ASYNC_ENABLE */
142Const SQL_BIND_TYPE = 5
143Const SQL_CURSOR_TYPE = 6
144Const SQL_CONCURRENCY = 7
145Const SQL_KEYSET_SIZE = 8
146Const SQL_ROWSET_SIZE = 9
147Const SQL_SIMULATE_CURSOR = 10
148Const SQL_RETRIEVE_DATA = 11
149Const SQL_USE_BOOKMARKS = 12
150Const SQL_GET_BOOKMARK = 13 /* GetStmtOption Only */
151Const SQL_ROW_NUMBER = 14 /* GetStmtOption Only */
152
153/* statement attributes for ODBC 3.0 */
154Const SQL_ATTR_ASYNC_ENABLE = 4
155Const SQL_ATTR_CONCURRENCY = SQL_CONCURRENCY
156Const SQL_ATTR_CURSOR_TYPE = SQL_CURSOR_TYPE
157Const SQL_ATTR_ENABLE_AUTO_IPD = 15
158Const SQL_ATTR_FETCH_BOOKMARK_PTR = 16
159Const SQL_ATTR_KEYSET_SIZE = SQL_KEYSET_SIZE
160Const SQL_ATTR_MAX_LENGTH = SQL_MAX_LENGTH
161Const SQL_ATTR_MAX_ROWS = SQL_MAX_ROWS
162Const SQL_ATTR_NOSCAN = SQL_NOSCAN
163Const SQL_ATTR_PARAM_BIND_OFFSET_PTR = 17
164Const SQL_ATTR_PARAM_BIND_TYPE = 18
165Const SQL_ATTR_PARAM_OPERATION_PTR = 19
166Const SQL_ATTR_PARAM_STATUS_PTR = 20
167Const SQL_ATTR_PARAMS_PROCESSED_PTR = 21
168Const SQL_ATTR_PARAMSET_SIZE = 22
169Const SQL_ATTR_QUERY_TIMEOUT = SQL_QUERY_TIMEOUT
170Const SQL_ATTR_RETRIEVE_DATA = SQL_RETRIEVE_DATA
171Const SQL_ATTR_ROW_BIND_OFFSET_PTR = 23
172Const SQL_ATTR_ROW_BIND_TYPE = SQL_BIND_TYPE
173Const SQL_ATTR_ROW_NUMBER = SQL_ROW_NUMBER /*GetStmtAttr*/
174Const SQL_ATTR_ROW_OPERATION_PTR = 24
175Const SQL_ATTR_ROW_STATUS_PTR = 25
176Const SQL_ATTR_ROWS_FETCHED_PTR = 26
177Const SQL_ATTR_ROW_ARRAY_SIZE = 27
178Const SQL_ATTR_SIMULATE_CURSOR = SQL_SIMULATE_CURSOR
179Const SQL_ATTR_USE_BOOKMARKS = SQL_USE_BOOKMARKS
180
181
182
183
184/* whether an attribute is a pointer or not */
185Const SQL_IS_POINTER = (-4)
186Const SQL_IS_UINTEGER = (-5)
187Const SQL_IS_INTEGER = (-6)
188Const SQL_IS_USMALLINT = (-7)
189Const SQL_IS_SMALLINT = (-8)
190
191
192/* the value of SQL_ATTR_PARAM_BIND_TYPE */
193Const SQL_PARAM_BIND_BY_COLUMN = 0
194Const SQL_PARAM_BIND_TYPE_DEFAULT = SQL_PARAM_BIND_BY_COLUMN
195
196
197/* SQL_QUERY_TIMEOUT options */
198Const SQL_QUERY_TIMEOUT_DEFAULT = 0
199
200/* SQL_MAX_ROWS options */
201Const SQL_MAX_ROWS_DEFAULT = 0
202
203/* SQL_NOSCAN options */
204Const SQL_NOSCAN_OFF = 0 /* 1.0 FALSE */
205Const SQL_NOSCAN_ON = 1 /* 1.0 TRUE */
206Const SQL_NOSCAN_DEFAULT = SQL_NOSCAN_OFF
207
208/* SQL_MAX_LENGTH options */
209Const SQL_MAX_LENGTH_DEFAULT = 0
210
211/* values for SQL_ATTR_ASYNC_ENABLE */
212Const SQL_ASYNC_ENABLE_OFF = 0
213Const SQL_ASYNC_ENABLE_ON = 1
214Const SQL_ASYNC_ENABLE_DEFAULT = SQL_ASYNC_ENABLE_OFF
215
216/* SQL_BIND_TYPE options */
217Const SQL_BIND_BY_COLUMN = 0
218Const SQL_BIND_TYPE_DEFAULT = SQL_BIND_BY_COLUMN /* Default value */
219
220/* SQL_CONCURRENCY options */
221Const SQL_CONCUR_READ_ONLY = 1
222Const SQL_CONCUR_LOCK = 2
223Const SQL_CONCUR_ROWVER = 3
224Const SQL_CONCUR_VALUES = 4
225Const SQL_CONCUR_DEFAULT = SQL_CONCUR_READ_ONLY /* Default value */
226
227/* SQL_CURSOR_TYPE options */
228Const SQL_CURSOR_FORWARD_ONLY = 0
229Const SQL_CURSOR_KEYSET_DRIVEN = 1
230Const SQL_CURSOR_DYNAMIC = 2
231Const SQL_CURSOR_STATIC = 3
232Const SQL_CURSOR_TYPE_DEFAULT = SQL_CURSOR_FORWARD_ONLY /* Default value */
233
234/* SQL_ROWSET_SIZE options */
235Const SQL_ROWSET_SIZE_DEFAULT = 1
236
237/* SQL_KEYSET_SIZE options */
238Const SQL_KEYSET_SIZE_DEFAULT = 0
239
240/* SQL_SIMULATE_CURSOR options */
241Const SQL_SC_NON_UNIQUE = 0
242Const SQL_SC_TRY_UNIQUE = 1
243Const SQL_SC_UNIQUE = 2
244
245/* SQL_RETRIEVE_DATA options */
246Const SQL_RD_OFF = 0
247Const SQL_RD_ON = 1
248Const SQL_RD_DEFAULT = SQL_RD_ON
249
250/* SQL_USE_BOOKMARKS options */
251Const SQL_UB_OFF = 0
252Const SQL_UB_ON = 01
253Const SQL_UB_DEFAULT = SQL_UB_OFF
254
255/* New values for SQL_USE_BOOKMARKS attribute */
256Const SQL_UB_FIXED = SQL_UB_ON
257Const SQL_UB_VARIABLE = 2
258
259
260/* SQLColAttributes defines */
261Const SQL_COLUMN_COUNT = 0
262Const SQL_COLUMN_NAME = 1
263Const SQL_COLUMN_TYPE = 2
264Const SQL_COLUMN_LENGTH = 3
265Const SQL_COLUMN_PRECISION = 4
266Const SQL_COLUMN_SCALE = 5
267Const SQL_COLUMN_DISPLAY_SIZE = 6
268Const SQL_COLUMN_NULLABLE = 7
269Const SQL_COLUMN_UNSIGNED = 8
270Const SQL_COLUMN_MONEY = 9
271Const SQL_COLUMN_UPDATABLE = 10
272Const SQL_COLUMN_AUTO_INCREMENT = 11
273Const SQL_COLUMN_CASE_SENSITIVE = 12
274Const SQL_COLUMN_SEARCHABLE = 13
275Const SQL_COLUMN_TYPE_NAME = 14
276Const SQL_COLUMN_TABLE_NAME = 15
277Const SQL_COLUMN_OWNER_NAME = 16
278Const SQL_COLUMN_QUALIFIER_NAME = 17
279Const SQL_COLUMN_LABEL = 18
280Const SQL_COLATT_OPT_MAX = SQL_COLUMN_LABEL
281
282
283/* extended descriptor field */
284Const SQL_DESC_ARRAY_SIZE = 20
285Const SQL_DESC_ARRAY_STATUS_PTR = 21
286Const SQL_DESC_AUTO_UNIQUE_VALUE = SQL_COLUMN_AUTO_INCREMENT
287Const SQL_DESC_BASE_COLUMN_NAME = 22
288Const SQL_DESC_BASE_TABLE_NAME = 23
289Const SQL_DESC_BIND_OFFSET_PTR = 24
290Const SQL_DESC_BIND_TYPE = 25
291Const SQL_DESC_CASE_SENSITIVE = SQL_COLUMN_CASE_SENSITIVE
292Const SQL_DESC_CATALOG_NAME = SQL_COLUMN_QUALIFIER_NAME
293Const SQL_DESC_CONCISE_TYPE = SQL_COLUMN_TYPE
294Const SQL_DESC_DATETIME_INTERVAL_PRECISION = 26
295Const SQL_DESC_DISPLAY_SIZE = SQL_COLUMN_DISPLAY_SIZE
296Const SQL_DESC_FIXED_PREC_SCALE = SQL_COLUMN_MONEY
297Const SQL_DESC_LABEL = SQL_COLUMN_LABEL
298Const SQL_DESC_LITERAL_PREFIX = 27
299Const SQL_DESC_LITERAL_SUFFIX = 28
300Const SQL_DESC_LOCAL_TYPE_NAME = 29
301Const SQL_DESC_MAXIMUM_SCALE = 30
302Const SQL_DESC_MINIMUM_SCALE = 31
303Const SQL_DESC_NUM_PREC_RADIX = 32
304Const SQL_DESC_PARAMETER_TYPE = 33
305Const SQL_DESC_ROWS_PROCESSED_PTR = 34
306Const SQL_DESC_ROWVER = 35
307Const SQL_DESC_SCHEMA_NAME = SQL_COLUMN_OWNER_NAME
308Const SQL_DESC_SEARCHABLE = SQL_COLUMN_SEARCHABLE
309Const SQL_DESC_TYPE_NAME = SQL_COLUMN_TYPE_NAME
310Const SQL_DESC_TABLE_NAME = SQL_COLUMN_TABLE_NAME
311Const SQL_DESC_UNSIGNED = SQL_COLUMN_UNSIGNED
312Const SQL_DESC_UPDATABLE = SQL_COLUMN_UPDATABLE
313
314
315/* defines for diagnostics fields */
316Const SQL_DIAG_CURSOR_ROW_COUNT = (-1249)
317Const SQL_DIAG_ROW_NUMBER = (-1248)
318Const SQL_DIAG_COLUMN_NUMBER = (-1247)
319
320/* SQL extended datatypes */
321Const SQL_DATE = 9
322Const SQL_INTERVAL = 10
323
324Const SQL_TIME = 10
325Const SQL_TIMESTAMP = 11
326Const SQL_LONGVARCHAR = (-1)
327Const SQL_BINARY = (-2)
328Const SQL_VARBINARY = (-3)
329Const SQL_LONGVARBINARY = (-4)
330Const SQL_BIGINT = (-5)
331Const SQL_TINYINT = (-6)
332Const SQL_BIT = (-7)
333Const SQL_GUID = (-11)
334
335/* interval code */
336Const SQL_CODE_YEAR = 1
337Const SQL_CODE_MONTH = 2
338Const SQL_CODE_DAY = 3
339Const SQL_CODE_HOUR = 4
340Const SQL_CODE_MINUTE = 5
341Const SQL_CODE_SECOND = 6
342Const SQL_CODE_YEAR_TO_MONTH = 7
343Const SQL_CODE_DAY_TO_HOUR = 8
344Const SQL_CODE_DAY_TO_MINUTE = 9
345Const SQL_CODE_DAY_TO_SECOND = 10
346Const SQL_CODE_HOUR_TO_MINUTE = 11
347Const SQL_CODE_HOUR_TO_SECOND = 12
348Const SQL_CODE_MINUTE_TO_SECOND = 13
349
350Const SQL_INTERVAL_YEAR = (100 + SQL_CODE_YEAR)
351Const SQL_INTERVAL_MONTH = (100 + SQL_CODE_MONTH)
352Const SQL_INTERVAL_DAY = (100 + SQL_CODE_DAY)
353Const SQL_INTERVAL_HOUR = (100 + SQL_CODE_HOUR)
354Const SQL_INTERVAL_MINUTE = (100 + SQL_CODE_MINUTE)
355Const SQL_INTERVAL_SECOND = (100 + SQL_CODE_SECOND)
356Const SQL_INTERVAL_YEAR_TO_MONTH = (100 + SQL_CODE_YEAR_TO_MONTH)
357Const SQL_INTERVAL_DAY_TO_HOUR = (100 + SQL_CODE_DAY_TO_HOUR)
358Const SQL_INTERVAL_DAY_TO_MINUTE = (100 + SQL_CODE_DAY_TO_MINUTE)
359Const SQL_INTERVAL_DAY_TO_SECOND = (100 + SQL_CODE_DAY_TO_SECOND)
360Const SQL_INTERVAL_HOUR_TO_MINUTE = (100 + SQL_CODE_HOUR_TO_MINUTE)
361Const SQL_INTERVAL_HOUR_TO_SECOND = (100 + SQL_CODE_HOUR_TO_SECOND)
362Const SQL_INTERVAL_MINUTE_TO_SECOND = (100 + SQL_CODE_MINUTE_TO_SECOND)
363
364
365
366/* C datatype to SQL datatype mapping SQL types
367 ------------------- */
368Const SQL_C_CHAR = SQL_CHAR /* CHAR, VARCHAR, DECIMAL, NUMERIC */
369Const SQL_C_LONG = SQL_INTEGER /* INTEGER */
370Const SQL_C_SHORT = SQL_SMALLINT /* SMALLINT */
371Const SQL_C_FLOAT = SQL_REAL /* REAL */
372Const SQL_C_DOUBLE = SQL_DOUBLE /* FLOAT, DOUBLE */
373Const SQL_C_NUMERIC = SQL_NUMERIC
374
375Const SQL_C_DEFAULT = 99
376
377Const SQL_SIGNED_OFFSET = (-20)
378Const SQL_UNSIGNED_OFFSET = (-22)
379
380/* C datatype to SQL datatype mapping */
381Const SQL_C_DATE = SQL_DATE
382Const SQL_C_TIME = SQL_TIME
383Const SQL_C_TIMESTAMP = SQL_TIMESTAMP
384Const SQL_C_TYPE_DATE = SQL_TYPE_DATE
385Const SQL_C_TYPE_TIME = SQL_TYPE_TIME
386Const SQL_C_TYPE_TIMESTAMP = SQL_TYPE_TIMESTAMP
387Const SQL_C_INTERVAL_YEAR = SQL_INTERVAL_YEAR
388Const SQL_C_INTERVAL_MONTH = SQL_INTERVAL_MONTH
389Const SQL_C_INTERVAL_DAY = SQL_INTERVAL_DAY
390Const SQL_C_INTERVAL_HOUR = SQL_INTERVAL_HOUR
391Const SQL_C_INTERVAL_MINUTE = SQL_INTERVAL_MINUTE
392Const SQL_C_INTERVAL_SECOND = SQL_INTERVAL_SECOND
393Const SQL_C_INTERVAL_YEAR_TO_MONTH = SQL_INTERVAL_YEAR_TO_MONTH
394Const SQL_C_INTERVAL_DAY_TO_HOUR = SQL_INTERVAL_DAY_TO_HOUR
395Const SQL_C_INTERVAL_DAY_TO_MINUTE = SQL_INTERVAL_DAY_TO_MINUTE
396Const SQL_C_INTERVAL_DAY_TO_SECOND = SQL_INTERVAL_DAY_TO_SECOND
397Const SQL_C_INTERVAL_HOUR_TO_MINUTE = SQL_INTERVAL_HOUR_TO_MINUTE
398Const SQL_C_INTERVAL_HOUR_TO_SECOND = SQL_INTERVAL_HOUR_TO_SECOND
399Const SQL_C_INTERVAL_MINUTE_TO_SECOND = SQL_INTERVAL_MINUTE_TO_SECOND
400
401Const SQL_C_BINARY = SQL_BINARY
402Const SQL_C_BIT = SQL_BIT
403Const SQL_C_SBIGINT = (SQL_BIGINT+SQL_SIGNED_OFFSET) /* SIGNED BIGINT */
404Const SQL_C_UBIGINT = (SQL_BIGINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED BIGINT */
405
406Const SQL_C_TINYINT = SQL_TINYINT
407Const SQL_C_SLONG = (SQL_C_LONG+SQL_SIGNED_OFFSET) /* SIGNED INTEGER */
408Const SQL_C_SSHORT = (SQL_C_SHORT+SQL_SIGNED_OFFSET) /* SIGNED SMALLINT */
409Const SQL_C_STINYINT = (SQL_TINYINT+SQL_SIGNED_OFFSET) /* SIGNED TINYINT */
410Const SQL_C_ULONG = (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/
411Const SQL_C_USHORT = (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/
412Const SQL_C_UTINYINT = (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/
413
414#ifdef _WIN64
415Const SQL_C_BOOKMARK = SQL_C_UBIGINT /* BOOKMARK */
416#else
417Const SQL_C_BOOKMARK = SQL_C_ULONG /* BOOKMARK */
418#endif
419
420
421Const SQL_TYPE_NULL = 0
422
423Const SQL_C_VARBOOKMARK = SQL_C_BINARY
424
425
426/* define for SQL_DIAG_ROW_NUMBER and SQL_DIAG_COLUMN_NUMBER */
427Const SQL_NO_ROW_NUMBER = (-1)
428Const SQL_NO_COLUMN_NUMBER = (-1)
429Const SQL_ROW_NUMBER_UNKNOWN = (-2)
430Const SQL_COLUMN_NUMBER_UNKNOWN = (-2)
431
432/* SQLBindParameter extensions */
433Const SQL_DEFAULT_PARAM = (-5)
434Const SQL_IGNORE = (-6)
435Const SQL_COLUMN_IGNORE = SQL_IGNORE
436
437Const SQL_LEN_DATA_AT_EXEC_OFFSET = (-100)
438#define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)
439
440/* binary length for driver specific attributes */
441Const SQL_LEN_BINARY_ATTR_OFFSET = (-100)
442#define SQL_LEN_BINARY_ATTR(length) (-(length)+SQL_LEN_BINARY_ATTR_OFFSET)
443
444/* Defines for SQLBindParameter and
445 SQLProcedureColumns (returned in the result set) */
446Const SQL_PARAM_TYPE_UNKNOWN = 0
447Const SQL_PARAM_INPUT = 1
448Const SQL_PARAM_INPUT_OUTPUT = 2
449Const SQL_RESULT_COL = 3
450Const SQL_PARAM_OUTPUT = 4
451Const SQL_RETURN_VALUE = 5
452
453/* Defines used by Driver Manager when mapping SQLSetParam to SQLBindParameter
454*/
455Const SQL_PARAM_TYPE_DEFAULT = SQL_PARAM_INPUT_OUTPUT
456Const SQL_SETPARAM_VALUE_MAX = (-1)
457
458
459Const SQL_COLATT_OPT_MIN = SQL_COLUMN_COUNT
460
461/* SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE */
462Const SQL_ATTR_READONLY = 0
463Const SQL_ATTR_WRITE = 1
464Const SQL_ATTR_READWRITE_UNKNOWN = 2
465
466/* SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE */
467/* These are also used by SQLGetInfo */
468Const SQL_UNSEARCHABLE = 0
469Const SQL_LIKE_ONLY = 1
470Const SQL_ALL_EXCEPT_LIKE = 2
471Const SQL_SEARCHABLE = 3
472Const SQL_PRED_SEARCHABLE = SQL_SEARCHABLE
473
474
475/* Special return values for SQLGetData */
476Const SQL_NO_TOTAL = (-4)
477
478/********************************************/
479/* SQLGetFunctions: additional values for */
480/* fFunction to represent functions that */
481/* are not in the X/Open spec. */
482/********************************************/
483
484Const SQL_API_SQLALLOCHANDLESTD = 73
485Const SQL_API_SQLBULKOPERATIONS = 24
486Const SQL_API_SQLBINDPARAMETER = 72
487Const SQL_API_SQLBROWSECONNECT = 55
488Const SQL_API_SQLCOLATTRIBUTES = 6
489Const SQL_API_SQLCOLUMNPRIVILEGES = 56
490Const SQL_API_SQLDESCRIBEPARAM = 58
491Const SQL_API_SQLDRIVERCONNECT = 41
492Const SQL_API_SQLDRIVERS = 71
493Const SQL_API_SQLEXTENDEDFETCH = 59
494Const SQL_API_SQLFOREIGNKEYS = 60
495Const SQL_API_SQLMORERESULTS = 61
496Const SQL_API_SQLNATIVESQL = 62
497Const SQL_API_SQLNUMPARAMS = 63
498Const SQL_API_SQLPARAMOPTIONS = 64
499Const SQL_API_SQLPRIMARYKEYS = 65
500Const SQL_API_SQLPROCEDURECOLUMNS = 66
501Const SQL_API_SQLPROCEDURES = 67
502Const SQL_API_SQLSETPOS = 68
503Const SQL_API_SQLSETSCROLLOPTIONS = 69
504Const SQL_API_SQLTABLEPRIVILEGES = 70
505
506
507/*--------------------------------------------*/
508/* SQL_API_ALL_FUNCTIONS returns an array */
509/* of 'booleans' representing whether a */
510/* function is implemented by the driver. */
511/* */
512/* CAUTION: Only functions defined in ODBC */
513/* version 2.0 and earlier are returned, the */
514/* new high-range function numbers defined by */
515/* X/Open break this scheme. See the new */
516/* method -- SQL_API_ODBC3_ALL_FUNCTIONS */
517/*--------------------------------------------*/
518
519Const SQL_API_ALL_FUNCTIONS = 0 /* See CAUTION above */
520
521/*----------------------------------------------*/
522/* 2.X drivers export a dummy function with */
523/* ordinal number SQL_API_LOADBYORDINAL to speed*/
524/* loading under the windows operating system. */
525/* */
526/* CAUTION: Loading by ordinal is not supported */
527/* for 3.0 and above drivers. */
528/*----------------------------------------------*/
529
530Const SQL_API_LOADBYORDINAL = 199 /* See CAUTION above */
531
532/*----------------------------------------------*/
533/* SQL_API_ODBC3_ALL_FUNCTIONS */
534/* This returns a bitmap, which allows us to */
535/* handle the higher-valued function numbers. */
536/* Use SQL_FUNC_EXISTS(bitmap,function_number) */
537/* to determine if the function exists. */
538/*----------------------------------------------*/
539
540
541Const SQL_API_ODBC3_ALL_FUNCTIONS = 999
542Const SQL_API_ODBC3_ALL_FUNCTIONS_SIZE = 250 /* array of 250 words */
543
544
545
546/************************************************/
547/* Extended definitions for SQLGetInfo */
548/************************************************/
549
550/*---------------------------------*/
551/* Values in ODBC 2.0 that are not */
552/* in the X/Open spec */
553/*---------------------------------*/
554
555Const SQL_INFO_FIRST = 0
556Const SQL_ACTIVE_CONNECTIONS = 0 /* MAX_DRIVER_CONNECTIONS */
557Const SQL_ACTIVE_STATEMENTS = 1 /* MAX_CONCURRENT_ACTIVITIES */
558Const SQL_DRIVER_HDBC = 3
559Const SQL_DRIVER_HENV = 4
560Const SQL_DRIVER_HSTMT = 5
561Const SQL_DRIVER_NAME = 6
562Const SQL_DRIVER_VER = 7
563Const SQL_ODBC_API_CONFORMANCE = 9
564Const SQL_ODBC_VER = 10
565Const SQL_ROW_UPDATES = 11
566Const SQL_ODBC_SAG_CLI_CONFORMANCE = 12
567Const SQL_ODBC_SQL_CONFORMANCE = 15
568Const SQL_PROCEDURES = 21
569Const SQL_CONCAT_NULL_BEHAVIOR = 22
570Const SQL_CURSOR_ROLLBACK_BEHAVIOR = 24
571Const SQL_EXPRESSIONS_IN_ORDERBY = 27
572Const SQL_MAX_OWNER_NAME_LEN = 32 /* MAX_SCHEMA_NAME_LEN */
573Const SQL_MAX_PROCEDURE_NAME_LEN = 33
574Const SQL_MAX_QUALIFIER_NAME_LEN = 34 /* MAX_CATALOG_NAME_LEN */
575Const SQL_MULT_RESULT_SETS = 36
576Const SQL_MULTIPLE_ACTIVE_TXN = 37
577Const SQL_OUTER_JOINS = 38
578Const SQL_OWNER_TERM = 39
579Const SQL_PROCEDURE_TERM = 40
580Const SQL_QUALIFIER_NAME_SEPARATOR = 41
581Const SQL_QUALIFIER_TERM = 42
582Const SQL_SCROLL_OPTIONS = 44
583Const SQL_TABLE_TERM = 45
584Const SQL_CONVERT_FUNCTIONS = 48
585Const SQL_NUMERIC_FUNCTIONS = 49
586Const SQL_STRING_FUNCTIONS = 50
587Const SQL_SYSTEM_FUNCTIONS = 51
588Const SQL_TIMEDATE_FUNCTIONS = 52
589Const SQL_CONVERT_BIGINT = 53
590Const SQL_CONVERT_BINARY = 54
591Const SQL_CONVERT_BIT = 55
592Const SQL_CONVERT_CHAR = 56
593Const SQL_CONVERT_DATE = 57
594Const SQL_CONVERT_DECIMAL = 58
595Const SQL_CONVERT_DOUBLE = 59
596Const SQL_CONVERT_FLOAT = 60
597Const SQL_CONVERT_INTEGER = 61
598Const SQL_CONVERT_LONGVARCHAR = 62
599Const SQL_CONVERT_NUMERIC = 63
600Const SQL_CONVERT_REAL = 64
601Const SQL_CONVERT_SMALLINT = 65
602Const SQL_CONVERT_TIME = 66
603Const SQL_CONVERT_TIMESTAMP = 67
604Const SQL_CONVERT_TINYINT = 68
605Const SQL_CONVERT_VARBINARY = 69
606Const SQL_CONVERT_VARCHAR = 70
607Const SQL_CONVERT_LONGVARBINARY = 71
608Const SQL_ODBC_SQL_OPT_IEF = 73 /* SQL_INTEGRITY */
609Const SQL_CORRELATION_NAME = 74
610Const SQL_NON_NULLABLE_COLUMNS = 75
611Const SQL_DRIVER_HLIB = 76
612Const SQL_DRIVER_ODBC_VER = 77
613Const SQL_LOCK_TYPES = 78
614Const SQL_POS_OPERATIONS = 79
615Const SQL_POSITIONED_STATEMENTS = 80
616Const SQL_BOOKMARK_PERSISTENCE = 82
617Const SQL_STATIC_SENSITIVITY = 83
618Const SQL_FILE_USAGE = 84
619Const SQL_COLUMN_ALIAS = 87
620Const SQL_GROUP_BY = 88
621Const SQL_KEYWORDS = 89
622Const SQL_OWNER_USAGE = 91
623Const SQL_QUALIFIER_USAGE = 92
624Const SQL_QUOTED_IDENTIFIER_CASE = 93
625Const SQL_SUBQUERIES = 95
626Const SQL_UNION = 96
627Const SQL_MAX_ROW_SIZE_INCLUDES_LONG = 103
628Const SQL_MAX_CHAR_LITERAL_LEN = 108
629Const SQL_TIMEDATE_ADD_INTERVALS = 109
630Const SQL_TIMEDATE_DIFF_INTERVALS = 110
631Const SQL_NEED_LONG_DATA_LEN = 111
632Const SQL_MAX_BINARY_LITERAL_LEN = 112
633Const SQL_LIKE_ESCAPE_CLAUSE = 113
634Const SQL_QUALIFIER_LOCATION = 114
635
636
637
638/*-----------------------------------------------*/
639/* ODBC 3.0 SQLGetInfo values that are not part */
640/* of the X/Open standard at this time. X/Open */
641/* standard values are in sql.h. */
642/*-----------------------------------------------*/
643
644Const SQL_ACTIVE_ENVIRONMENTS = 116
645Const SQL_ALTER_DOMAIN = 117
646
647Const SQL_SQL_CONFORMANCE = 118
648Const SQL_DATETIME_LITERALS = 119
649
650Const SQL_ASYNC_MODE = 10021 /* new X/Open spec */
651Const SQL_BATCH_ROW_COUNT = 120
652Const SQL_BATCH_SUPPORT = 121
653Const SQL_CATALOG_LOCATION = SQL_QUALIFIER_LOCATION
654Const SQL_CATALOG_NAME_SEPARATOR = SQL_QUALIFIER_NAME_SEPARATOR
655Const SQL_CATALOG_TERM = SQL_QUALIFIER_TERM
656Const SQL_CATALOG_USAGE = SQL_QUALIFIER_USAGE
657Const SQL_CONVERT_WCHAR = 122
658Const SQL_CONVERT_INTERVAL_DAY_TIME = 123
659Const SQL_CONVERT_INTERVAL_YEAR_MONTH = 124
660Const SQL_CONVERT_WLONGVARCHAR = 125
661Const SQL_CONVERT_WVARCHAR = 126
662Const SQL_CREATE_ASSERTION = 127
663Const SQL_CREATE_CHARACTER_SET = 128
664Const SQL_CREATE_COLLATION = 129
665Const SQL_CREATE_DOMAIN = 130
666Const SQL_CREATE_SCHEMA = 131
667Const SQL_CREATE_TABLE = 132
668Const SQL_CREATE_TRANSLATION = 133
669Const SQL_CREATE_VIEW = 134
670Const SQL_DRIVER_HDESC = 135
671Const SQL_DROP_ASSERTION = 136
672Const SQL_DROP_CHARACTER_SET = 137
673Const SQL_DROP_COLLATION = 138
674Const SQL_DROP_DOMAIN = 139
675Const SQL_DROP_SCHEMA = 140
676Const SQL_DROP_TABLE = 141
677Const SQL_DROP_TRANSLATION = 142
678Const SQL_DROP_VIEW = 143
679Const SQL_DYNAMIC_CURSOR_ATTRIBUTES1 = 144
680Const SQL_DYNAMIC_CURSOR_ATTRIBUTES2 = 145
681Const SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 = 146
682Const SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 = 147
683Const SQL_INDEX_KEYWORDS = 148
684Const SQL_INFO_SCHEMA_VIEWS = 149
685Const SQL_KEYSET_CURSOR_ATTRIBUTES1 = 150
686Const SQL_KEYSET_CURSOR_ATTRIBUTES2 = 151
687Const SQL_MAX_ASYNC_CONCURRENT_STATEMENTS = 10022 /* new X/Open spec */
688Const SQL_ODBC_INTERFACE_CONFORMANCE = 152
689Const SQL_PARAM_ARRAY_ROW_COUNTS = 153
690Const SQL_PARAM_ARRAY_SELECTS = 154
691Const SQL_SCHEMA_TERM = SQL_OWNER_TERM
692Const SQL_SCHEMA_USAGE = SQL_OWNER_USAGE
693Const SQL_SQL92_DATETIME_FUNCTIONS = 155
694Const SQL_SQL92_FOREIGN_KEY_DELETE_RULE = 156
695Const SQL_SQL92_FOREIGN_KEY_UPDATE_RULE = 157
696Const SQL_SQL92_GRANT = 158
697Const SQL_SQL92_NUMERIC_VALUE_FUNCTIONS = 159
698Const SQL_SQL92_PREDICATES = 160
699Const SQL_SQL92_RELATIONAL_JOIN_OPERATORS = 161
700Const SQL_SQL92_REVOKE = 162
701Const SQL_SQL92_ROW_VALUE_CONSTRUCTOR = 163
702Const SQL_SQL92_STRING_FUNCTIONS = 164
703Const SQL_SQL92_VALUE_EXPRESSIONS = 165
704Const SQL_STANDARD_CLI_CONFORMANCE = 166
705Const SQL_STATIC_CURSOR_ATTRIBUTES1 = 167
706Const SQL_STATIC_CURSOR_ATTRIBUTES2 = 168
707
708Const SQL_AGGREGATE_FUNCTIONS = 169
709Const SQL_DDL_INDEX = 170
710Const SQL_DM_VER = 171
711Const SQL_INSERT_STATEMENT = 172
712Const SQL_CONVERT_GUID = 173
713Const SQL_UNION_STATEMENT = SQL_UNION
714
715
716Const SQL_DTC_TRANSITION_COST = 1750
717
718/* SQL_ALTER_TABLE bitmasks */
719/* the following 5 bitmasks are defined in sql.h
720*Const SQL_AT_ADD_COLUMN = &H00000001
721*Const SQL_AT_DROP_COLUMN = &H00000002
722*Const SQL_AT_ADD_CONSTRAINT = &H00000008
723*/
724Const SQL_AT_ADD_COLUMN_SINGLE = &H00000020
725Const SQL_AT_ADD_COLUMN_DEFAULT = &H00000040
726Const SQL_AT_ADD_COLUMN_COLLATION = &H00000080
727Const SQL_AT_SET_COLUMN_DEFAULT = &H00000100
728Const SQL_AT_DROP_COLUMN_DEFAULT = &H00000200
729Const SQL_AT_DROP_COLUMN_CASCADE = &H00000400
730Const SQL_AT_DROP_COLUMN_RESTRICT = &H00000800
731Const SQL_AT_ADD_TABLE_CONSTRAINT = &H00001000
732Const SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE = &H00002000
733Const SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT = &H00004000
734Const SQL_AT_CONSTRAINT_NAME_DEFINITION = &H00008000
735Const SQL_AT_CONSTRAINT_INITIALLY_DEFERRED = &H00010000
736Const SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE = &H00020000
737Const SQL_AT_CONSTRAINT_DEFERRABLE = &H00040000
738Const SQL_AT_CONSTRAINT_NON_DEFERRABLE = &H00080000
739
740/* SQL_CONVERT_* return value bitmasks */
741
742Const SQL_CVT_CHAR = &H00000001
743Const SQL_CVT_NUMERIC = &H00000002
744Const SQL_CVT_DECIMAL = &H00000004
745Const SQL_CVT_INTEGER = &H00000008
746Const SQL_CVT_SMALLINT = &H00000010
747Const SQL_CVT_FLOAT = &H00000020
748Const SQL_CVT_REAL = &H00000040
749Const SQL_CVT_DOUBLE = &H00000080
750Const SQL_CVT_VARCHAR = &H00000100
751Const SQL_CVT_LONGVARCHAR = &H00000200
752Const SQL_CVT_BINARY = &H00000400
753Const SQL_CVT_VARBINARY = &H00000800
754Const SQL_CVT_BIT = &H00001000
755Const SQL_CVT_TINYINT = &H00002000
756Const SQL_CVT_BIGINT = &H00004000
757Const SQL_CVT_DATE = &H00008000
758Const SQL_CVT_TIME = &H00010000
759Const SQL_CVT_TIMESTAMP = &H00020000
760Const SQL_CVT_LONGVARBINARY = &H00040000
761Const SQL_CVT_INTERVAL_YEAR_MONTH = &H00080000
762Const SQL_CVT_INTERVAL_DAY_TIME = &H00100000
763Const SQL_CVT_WCHAR = &H00200000
764Const SQL_CVT_WLONGVARCHAR = &H00400000
765Const SQL_CVT_WVARCHAR = &H00800000
766Const SQL_CVT_GUID = &H01000000
767
768
769
770
771/* SQL_CONVERT_FUNCTIONS functions */
772Const SQL_FN_CVT_CONVERT = &H00000001
773Const SQL_FN_CVT_CAST = &H00000002
774
775
776
777/* SQL_STRING_FUNCTIONS functions */
778
779Const SQL_FN_STR_CONCAT = &H00000001
780Const SQL_FN_STR_INSERT = &H00000002
781Const SQL_FN_STR_LEFT = &H00000004
782Const SQL_FN_STR_LTRIM = &H00000008
783Const SQL_FN_STR_LENGTH = &H00000010
784Const SQL_FN_STR_LOCATE = &H00000020
785Const SQL_FN_STR_LCASE = &H00000040
786Const SQL_FN_STR_REPEAT = &H00000080
787Const SQL_FN_STR_REPLACE = &H00000100
788Const SQL_FN_STR_RIGHT = &H00000200
789Const SQL_FN_STR_RTRIM = &H00000400
790Const SQL_FN_STR_SUBSTRING = &H00000800
791Const SQL_FN_STR_UCASE = &H00001000
792Const SQL_FN_STR_ASCII = &H00002000
793Const SQL_FN_STR_CHAR = &H00004000
794Const SQL_FN_STR_DIFFERENCE = &H00008000
795Const SQL_FN_STR_LOCATE_2 = &H00010000
796Const SQL_FN_STR_SOUNDEX = &H00020000
797Const SQL_FN_STR_SPACE = &H00040000
798Const SQL_FN_STR_BIT_LENGTH = &H00080000
799Const SQL_FN_STR_CHAR_LENGTH = &H00100000
800Const SQL_FN_STR_CHARACTER_LENGTH = &H00200000
801Const SQL_FN_STR_OCTET_LENGTH = &H00400000
802Const SQL_FN_STR_POSITION = &H00800000
803
804
805/* SQL_SQL92_STRING_FUNCTIONS */
806Const SQL_SSF_CONVERT = &H00000001
807Const SQL_SSF_LOWER = &H00000002
808Const SQL_SSF_UPPER = &H00000004
809Const SQL_SSF_SUBSTRING = &H00000008
810Const SQL_SSF_TRANSLATE = &H00000010
811Const SQL_SSF_TRIM_BOTH = &H00000020
812Const SQL_SSF_TRIM_LEADING = &H00000040
813Const SQL_SSF_TRIM_TRAILING = &H00000080
814
815/* SQL_NUMERIC_FUNCTIONS functions */
816
817Const SQL_FN_NUM_ABS = &H00000001
818Const SQL_FN_NUM_ACOS = &H00000002
819Const SQL_FN_NUM_ASIN = &H00000004
820Const SQL_FN_NUM_ATAN = &H00000008
821Const SQL_FN_NUM_ATAN2 = &H00000010
822Const SQL_FN_NUM_CEILING = &H00000020
823Const SQL_FN_NUM_COS = &H00000040
824Const SQL_FN_NUM_COT = &H00000080
825Const SQL_FN_NUM_EXP = &H00000100
826Const SQL_FN_NUM_FLOOR = &H00000200
827Const SQL_FN_NUM_LOG = &H00000400
828Const SQL_FN_NUM_MOD = &H00000800
829Const SQL_FN_NUM_SIGN = &H00001000
830Const SQL_FN_NUM_SIN = &H00002000
831Const SQL_FN_NUM_SQRT = &H00004000
832Const SQL_FN_NUM_TAN = &H00008000
833Const SQL_FN_NUM_PI = &H00010000
834Const SQL_FN_NUM_RAND = &H00020000
835Const SQL_FN_NUM_DEGREES = &H00040000
836Const SQL_FN_NUM_LOG10 = &H00080000
837Const SQL_FN_NUM_POWER = &H00100000
838Const SQL_FN_NUM_RADIANS = &H00200000
839Const SQL_FN_NUM_ROUND = &H00400000
840Const SQL_FN_NUM_TRUNCATE = &H00800000
841
842/* SQL_SQL92_NUMERIC_VALUE_FUNCTIONS */
843Const SQL_SNVF_BIT_LENGTH = &H00000001
844Const SQL_SNVF_CHAR_LENGTH = &H00000002
845Const SQL_SNVF_CHARACTER_LENGTH = &H00000004
846Const SQL_SNVF_EXTRACT = &H00000008
847Const SQL_SNVF_OCTET_LENGTH = &H00000010
848Const SQL_SNVF_POSITION = &H00000020
849
850
851/* SQL_TIMEDATE_FUNCTIONS functions */
852
853Const SQL_FN_TD_NOW = &H00000001
854Const SQL_FN_TD_CURDATE = &H00000002
855Const SQL_FN_TD_DAYOFMONTH = &H00000004
856Const SQL_FN_TD_DAYOFWEEK = &H00000008
857Const SQL_FN_TD_DAYOFYEAR = &H00000010
858Const SQL_FN_TD_MONTH = &H00000020
859Const SQL_FN_TD_QUARTER = &H00000040
860Const SQL_FN_TD_WEEK = &H00000080
861Const SQL_FN_TD_YEAR = &H00000100
862Const SQL_FN_TD_CURTIME = &H00000200
863Const SQL_FN_TD_HOUR = &H00000400
864Const SQL_FN_TD_MINUTE = &H00000800
865Const SQL_FN_TD_SECOND = &H00001000
866Const SQL_FN_TD_TIMESTAMPADD = &H00002000
867Const SQL_FN_TD_TIMESTAMPDIFF = &H00004000
868Const SQL_FN_TD_DAYNAME = &H00008000
869Const SQL_FN_TD_MONTHNAME = &H00010000
870Const SQL_FN_TD_CURRENT_DATE = &H00020000
871Const SQL_FN_TD_CURRENT_TIME = &H00040000
872Const SQL_FN_TD_CURRENT_TIMESTAMP = &H00080000
873Const SQL_FN_TD_EXTRACT = &H00100000
874
875
876/* SQL_SQL92_DATETIME_FUNCTIONS */
877Const SQL_SDF_CURRENT_DATE = &H00000001
878Const SQL_SDF_CURRENT_TIME = &H00000002
879Const SQL_SDF_CURRENT_TIMESTAMP = &H00000004
880
881/* SQL_SYSTEM_FUNCTIONS functions */
882
883Const SQL_FN_SYS_USERNAME = &H00000001
884Const SQL_FN_SYS_DBNAME = &H00000002
885Const SQL_FN_SYS_IFNULL = &H00000004
886
887/* SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions */
888
889Const SQL_FN_TSI_FRAC_SECOND = &H00000001
890Const SQL_FN_TSI_SECOND = &H00000002
891Const SQL_FN_TSI_MINUTE = &H00000004
892Const SQL_FN_TSI_HOUR = &H00000008
893Const SQL_FN_TSI_DAY = &H00000010
894Const SQL_FN_TSI_WEEK = &H00000020
895Const SQL_FN_TSI_MONTH = &H00000040
896Const SQL_FN_TSI_QUARTER = &H00000080
897Const SQL_FN_TSI_YEAR = &H00000100
898
899/* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES1,
900 * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1,
901 * SQL_KEYSET_CURSOR_ATTRIBUTES1, and SQL_STATIC_CURSOR_ATTRIBUTES1
902 */
903/* supported SQLFetchScroll FetchOrientation's */
904Const SQL_CA1_NEXT = &H00000001
905Const SQL_CA1_ABSOLUTE = &H00000002
906Const SQL_CA1_RELATIVE = &H00000004
907Const SQL_CA1_BOOKMARK = &H00000008
908
909/* supported SQLSetPos LockType's */
910Const SQL_CA1_LOCK_NO_CHANGE = &H00000040
911Const SQL_CA1_LOCK_EXCLUSIVE = &H00000080
912Const SQL_CA1_LOCK_UNLOCK = &H00000100
913
914/* supported SQLSetPos Operations */
915Const SQL_CA1_POS_POSITION = &H00000200
916Const SQL_CA1_POS_UPDATE = &H00000400
917Const SQL_CA1_POS_DELETE = &H00000800
918Const SQL_CA1_POS_REFRESH = &H00001000
919
920/* positioned updates and deletes */
921Const SQL_CA1_POSITIONED_UPDATE = &H00002000
922Const SQL_CA1_POSITIONED_DELETE = &H00004000
923Const SQL_CA1_SELECT_FOR_UPDATE = &H00008000
924
925/* supported SQLBulkOperations operations */
926Const SQL_CA1_BULK_ADD = &H00010000
927Const SQL_CA1_BULK_UPDATE_BY_BOOKMARK = &H00020000
928Const SQL_CA1_BULK_DELETE_BY_BOOKMARK = &H00040000
929Const SQL_CA1_BULK_FETCH_BY_BOOKMARK = &H00080000
930
931
932/* bitmasks for SQL_DYNAMIC_CURSOR_ATTRIBUTES2,
933 * SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2,
934 * SQL_KEYSET_CURSOR_ATTRIBUTES2, and SQL_STATIC_CURSOR_ATTRIBUTES2
935 */
936/* supported values for SQL_ATTR_SCROLL_CONCURRENCY */
937Const SQL_CA2_READ_ONLY_CONCURRENCY = &H00000001
938Const SQL_CA2_LOCK_CONCURRENCY = &H00000002
939Const SQL_CA2_OPT_ROWVER_CONCURRENCY = &H00000004
940Const SQL_CA2_OPT_VALUES_CONCURRENCY = &H00000008
941
942/* sensitivity of the cursor to its own inserts, deletes, and updates */
943Const SQL_CA2_SENSITIVITY_ADDITIONS = &H00000010
944Const SQL_CA2_SENSITIVITY_DELETIONS = &H00000020
945Const SQL_CA2_SENSITIVITY_UPDATES = &H00000040
946
947/* semantics of SQL_ATTR_MAX_ROWS */
948Const SQL_CA2_MAX_ROWS_SELECT = &H00000080
949Const SQL_CA2_MAX_ROWS_INSERT = &H00000100
950Const SQL_CA2_MAX_ROWS_DELETE = &H00000200
951Const SQL_CA2_MAX_ROWS_UPDATE = &H00000400
952Const SQL_CA2_MAX_ROWS_CATALOG = &H00000800
953Const SQL_CA2_MAX_ROWS_AFFECTS_ALL = (SQL_CA2_MAX_ROWS_SELECT or _
954 SQL_CA2_MAX_ROWS_INSERT or SQL_CA2_MAX_ROWS_DELETE or _
955 SQL_CA2_MAX_ROWS_UPDATE or SQL_CA2_MAX_ROWS_CATALOG)
956
957/* semantics of SQL_DIAG_CURSOR_ROW_COUNT */
958Const SQL_CA2_CRC_EXACT = &H00001000
959Const SQL_CA2_CRC_APPROXIMATE = &H00002000
960
961/* the kinds of positioned statements that can be simulated */
962Const SQL_CA2_SIMULATE_NON_UNIQUE = &H00004000
963Const SQL_CA2_SIMULATE_TRY_UNIQUE = &H00008000
964Const SQL_CA2_SIMULATE_UNIQUE = &H00010000
965
966
967/* SQL_ODBC_API_CONFORMANCE values */
968
969Const SQL_OAC_NONE = &H0000
970Const SQL_OAC_LEVEL1 = &H0001
971Const SQL_OAC_LEVEL2 = &H0002
972
973/* SQL_ODBC_SAG_CLI_CONFORMANCE values */
974
975Const SQL_OSCC_NOT_COMPLIANT = &H0000
976Const SQL_OSCC_COMPLIANT = &H0001
977
978/* SQL_ODBC_SQL_CONFORMANCE values */
979
980Const SQL_OSC_MINIMUM = &H0000
981Const SQL_OSC_CORE = &H0001
982Const SQL_OSC_EXTENDED = &H0002
983
984
985/* SQL_CONCAT_NULL_BEHAVIOR values */
986
987Const SQL_CB_NULL = &H0000
988Const SQL_CB_NON_NULL = &H0001
989
990/* SQL_SCROLL_OPTIONS masks */
991
992Const SQL_SO_FORWARD_ONLY = &H00000001
993Const SQL_SO_KEYSET_DRIVEN = &H00000002
994Const SQL_SO_DYNAMIC = &H00000004
995Const SQL_SO_MIXED = &H00000008
996Const SQL_SO_STATIC = &H00000010
997
998/* SQL_FETCH_DIRECTION masks */
999
1000/* SQL_FETCH_RESUME is no longer supported
1001Const SQL_FD_FETCH_RESUME = &H00000040
1002*/
1003Const SQL_FD_FETCH_BOOKMARK = &H00000080
1004
1005/* SQL_TXN_ISOLATION_OPTION masks */
1006/* SQL_TXN_VERSIONING is no longer supported
1007Const SQL_TXN_VERSIONING = &H00000010
1008*/
1009
1010/* SQL_CORRELATION_NAME values */
1011
1012Const SQL_CN_NONE = &H0000
1013Const SQL_CN_DIFFERENT = &H0001
1014Const SQL_CN_ANY = &H0002
1015
1016/* SQL_NON_NULLABLE_COLUMNS values */
1017
1018Const SQL_NNC_NULL = &H0000
1019Const SQL_NNC_NON_NULL = &H0001
1020
1021/* SQL_NULL_COLLATION values */
1022
1023Const SQL_NC_START = &H0002
1024Const SQL_NC_END = &H0004
1025
1026/* SQL_FILE_USAGE values */
1027
1028Const SQL_FILE_NOT_SUPPORTED = &H0000
1029Const SQL_FILE_TABLE = &H0001
1030Const SQL_FILE_QUALIFIER = &H0002
1031Const SQL_FILE_CATALOG = SQL_FILE_QUALIFIER ' ODBC 3.0
1032
1033
1034/* SQL_GETDATA_EXTENSIONS values */
1035
1036Const SQL_GD_BLOCK = &H00000004
1037Const SQL_GD_BOUND = &H00000008
1038
1039/* SQL_POSITIONED_STATEMENTS masks */
1040
1041Const SQL_PS_POSITIONED_DELETE = &H00000001
1042Const SQL_PS_POSITIONED_UPDATE = &H00000002
1043Const SQL_PS_SELECT_FOR_UPDATE = &H00000004
1044
1045/* SQL_GROUP_BY values */
1046
1047Const SQL_GB_NOT_SUPPORTED = &H0000
1048Const SQL_GB_GROUP_BY_EQUALS_SELECT = &H0001
1049Const SQL_GB_GROUP_BY_CONTAINS_SELECT = &H0002
1050Const SQL_GB_NO_RELATION = &H0003
1051Const SQL_GB_COLLATE = &H0004
1052
1053
1054
1055/* SQL_OWNER_USAGE masks */
1056
1057Const SQL_OU_DML_STATEMENTS = &H00000001
1058Const SQL_OU_PROCEDURE_INVOCATION = &H00000002
1059Const SQL_OU_TABLE_DEFINITION = &H00000004
1060Const SQL_OU_INDEX_DEFINITION = &H00000008
1061Const SQL_OU_PRIVILEGE_DEFINITION = &H00000010
1062
1063/* SQL_SCHEMA_USAGE masks */
1064Const SQL_SU_DML_STATEMENTS = SQL_OU_DML_STATEMENTS
1065Const SQL_SU_PROCEDURE_INVOCATION = SQL_OU_PROCEDURE_INVOCATION
1066Const SQL_SU_TABLE_DEFINITION = SQL_OU_TABLE_DEFINITION
1067Const SQL_SU_INDEX_DEFINITION = SQL_OU_INDEX_DEFINITION
1068Const SQL_SU_PRIVILEGE_DEFINITION = SQL_OU_PRIVILEGE_DEFINITION
1069
1070
1071/* SQL_QUALIFIER_USAGE masks */
1072
1073Const SQL_QU_DML_STATEMENTS = &H00000001
1074Const SQL_QU_PROCEDURE_INVOCATION = &H00000002
1075Const SQL_QU_TABLE_DEFINITION = &H00000004
1076Const SQL_QU_INDEX_DEFINITION = &H00000008
1077Const SQL_QU_PRIVILEGE_DEFINITION = &H00000010
1078
1079/* SQL_CATALOG_USAGE masks */
1080Const SQL_CU_DML_STATEMENTS = SQL_QU_DML_STATEMENTS
1081Const SQL_CU_PROCEDURE_INVOCATION = SQL_QU_PROCEDURE_INVOCATION
1082Const SQL_CU_TABLE_DEFINITION = SQL_QU_TABLE_DEFINITION
1083Const SQL_CU_INDEX_DEFINITION = SQL_QU_INDEX_DEFINITION
1084Const SQL_CU_PRIVILEGE_DEFINITION = SQL_QU_PRIVILEGE_DEFINITION
1085
1086
1087/* SQL_SUBQUERIES masks */
1088
1089Const SQL_SQ_COMPARISON = &H00000001
1090Const SQL_SQ_EXISTS = &H00000002
1091Const SQL_SQ_IN = &H00000004
1092Const SQL_SQ_QUANTIFIED = &H00000008
1093Const SQL_SQ_CORRELATED_SUBQUERIES = &H00000010
1094
1095/* SQL_UNION masks */
1096
1097Const SQL_U_UNION = &H00000001
1098Const SQL_U_UNION_ALL = &H00000002
1099
1100/* SQL_BOOKMARK_PERSISTENCE values */
1101
1102Const SQL_BP_CLOSE = &H00000001
1103Const SQL_BP_DELETE = &H00000002
1104Const SQL_BP_DROP = &H00000004
1105Const SQL_BP_TRANSACTION = &H00000008
1106Const SQL_BP_UPDATE = &H00000010
1107Const SQL_BP_OTHER_HSTMT = &H00000020
1108Const SQL_BP_SCROLL = &H00000040
1109
1110/* SQL_STATIC_SENSITIVITY values */
1111
1112Const SQL_SS_ADDITIONS = &H00000001
1113Const SQL_SS_DELETIONS = &H00000002
1114Const SQL_SS_UPDATES = &H00000004
1115
1116/* SQL_VIEW values */
1117Const SQL_CV_CREATE_VIEW = &H00000001
1118Const SQL_CV_CHECK_OPTION = &H00000002
1119Const SQL_CV_CASCADED = &H00000004
1120Const SQL_CV_LOCAL = &H00000008
1121
1122/* SQL_LOCK_TYPES masks */
1123
1124Const SQL_LCK_NO_CHANGE = &H00000001
1125Const SQL_LCK_EXCLUSIVE = &H00000002
1126Const SQL_LCK_UNLOCK = &H00000004
1127
1128/* SQL_POS_OPERATIONS masks */
1129
1130Const SQL_POS_POSITION = &H00000001
1131Const SQL_POS_REFRESH = &H00000002
1132Const SQL_POS_UPDATE = &H00000004
1133Const SQL_POS_DELETE = &H00000008
1134Const SQL_POS_ADD = &H00000010
1135
1136/* SQL_QUALIFIER_LOCATION values */
1137
1138Const SQL_QL_START = &H0001
1139Const SQL_QL_END = &H0002
1140
1141/* Here start return values for ODBC 3.0 SQLGetInfo */
1142
1143/* SQL_AGGREGATE_FUNCTIONS bitmasks */
1144Const SQL_AF_AVG = &H00000001
1145Const SQL_AF_COUNT = &H00000002
1146Const SQL_AF_MAX = &H00000004
1147Const SQL_AF_MIN = &H00000008
1148Const SQL_AF_SUM = &H00000010
1149Const SQL_AF_DISTINCT = &H00000020
1150Const SQL_AF_ALL = &H00000040
1151
1152/* SQL_SQL_CONFORMANCE bit masks */
1153Const SQL_SC_SQL92_ENTRY = &H00000001
1154Const SQL_SC_FIPS127_2_TRANSITIONAL = &H00000002
1155Const SQL_SC_SQL92_INTERMEDIATE = &H00000004
1156Const SQL_SC_SQL92_FULL = &H00000008
1157
1158/* SQL_DATETIME_LITERALS masks */
1159Const SQL_DL_SQL92_DATE = &H00000001
1160Const SQL_DL_SQL92_TIME = &H00000002
1161Const SQL_DL_SQL92_TIMESTAMP = &H00000004
1162Const SQL_DL_SQL92_INTERVAL_YEAR = &H00000008
1163Const SQL_DL_SQL92_INTERVAL_MONTH = &H00000010
1164Const SQL_DL_SQL92_INTERVAL_DAY = &H00000020
1165Const SQL_DL_SQL92_INTERVAL_HOUR = &H00000040
1166Const SQL_DL_SQL92_INTERVAL_MINUTE = &H00000080
1167Const SQL_DL_SQL92_INTERVAL_SECOND = &H00000100
1168Const SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH = &H00000200
1169Const SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR = &H00000400
1170Const SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE = &H00000800
1171Const SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND = &H00001000
1172Const SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE = &H00002000
1173Const SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND = &H00004000
1174Const SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND = &H00008000
1175
1176/* SQL_CATALOG_LOCATION values */
1177Const SQL_CL_START = SQL_QL_START
1178Const SQL_CL_END = SQL_QL_END
1179
1180/* values for SQL_BATCH_ROW_COUNT */
1181Const SQL_BRC_PROCEDURES = &H0000001
1182Const SQL_BRC_EXPLICIT = &H0000002
1183Const SQL_BRC_ROLLED_UP = &H0000004
1184
1185/* bitmasks for SQL_BATCH_SUPPORT */
1186Const SQL_BS_SELECT_EXPLICIT = &H00000001
1187Const SQL_BS_ROW_COUNT_EXPLICIT = &H00000002
1188Const SQL_BS_SELECT_PROC = &H00000004
1189Const SQL_BS_ROW_COUNT_PROC = &H00000008
1190
1191/* Values for SQL_PARAM_ARRAY_ROW_COUNTS getinfo */
1192Const SQL_PARC_BATCH = 1
1193Const SQL_PARC_NO_BATCH = 2
1194
1195/* values for SQL_PARAM_ARRAY_SELECTS */
1196Const SQL_PAS_BATCH = 1
1197Const SQL_PAS_NO_BATCH = 2
1198Const SQL_PAS_NO_SELECT = 3
1199
1200/* Bitmasks for SQL_INDEX_KEYWORDS */
1201Const SQL_IK_NONE = &H00000000
1202Const SQL_IK_ASC = &H00000001
1203Const SQL_IK_DESC = &H00000002
1204Const SQL_IK_ALL = (SQL_IK_ASC or SQL_IK_DESC)
1205
1206/* Bitmasks for SQL_INFO_SCHEMA_VIEWS */
1207
1208Const SQL_ISV_ASSERTIONS = &H00000001
1209Const SQL_ISV_CHARACTER_SETS = &H00000002
1210Const SQL_ISV_CHECK_CONSTRAINTS = &H00000004
1211Const SQL_ISV_COLLATIONS = &H00000008
1212Const SQL_ISV_COLUMN_DOMAIN_USAGE = &H00000010
1213Const SQL_ISV_COLUMN_PRIVILEGES = &H00000020
1214Const SQL_ISV_COLUMNS = &H00000040
1215Const SQL_ISV_CONSTRAINT_COLUMN_USAGE = &H00000080
1216Const SQL_ISV_CONSTRAINT_TABLE_USAGE = &H00000100
1217Const SQL_ISV_DOMAIN_CONSTRAINTS = &H00000200
1218Const SQL_ISV_DOMAINS = &H00000400
1219Const SQL_ISV_KEY_COLUMN_USAGE = &H00000800
1220Const SQL_ISV_REFERENTIAL_CONSTRAINTS = &H00001000
1221Const SQL_ISV_SCHEMATA = &H00002000
1222Const SQL_ISV_SQL_LANGUAGES = &H00004000
1223Const SQL_ISV_TABLE_CONSTRAINTS = &H00008000
1224Const SQL_ISV_TABLE_PRIVILEGES = &H00010000
1225Const SQL_ISV_TABLES = &H00020000
1226Const SQL_ISV_TRANSLATIONS = &H00040000
1227Const SQL_ISV_USAGE_PRIVILEGES = &H00080000
1228Const SQL_ISV_VIEW_COLUMN_USAGE = &H00100000
1229Const SQL_ISV_VIEW_TABLE_USAGE = &H00200000
1230Const SQL_ISV_VIEWS = &H00400000
1231
1232
1233/* Bitmasks for SQL_ALTER_DOMAIN */
1234Const SQL_AD_CONSTRAINT_NAME_DEFINITION = &H00000001
1235Const SQL_AD_ADD_DOMAIN_CONSTRAINT = &H00000002
1236Const SQL_AD_DROP_DOMAIN_CONSTRAINT = &H00000004
1237Const SQL_AD_ADD_DOMAIN_DEFAULT = &H00000008
1238Const SQL_AD_DROP_DOMAIN_DEFAULT = &H00000010
1239Const SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED = &H00000020
1240Const SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE = &H00000040
1241Const SQL_AD_ADD_CONSTRAINT_DEFERRABLE = &H00000080
1242Const SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE = &H00000100
1243
1244
1245/* SQL_CREATE_SCHEMA bitmasks */
1246Const SQL_CS_CREATE_SCHEMA = &H00000001
1247Const SQL_CS_AUTHORIZATION = &H00000002
1248Const SQL_CS_DEFAULT_CHARACTER_SET = &H00000004
1249
1250/* SQL_CREATE_TRANSLATION bitmasks */
1251Const SQL_CTR_CREATE_TRANSLATION = &H00000001
1252
1253/* SQL_CREATE_ASSERTION bitmasks */
1254Const SQL_CA_CREATE_ASSERTION = &H00000001
1255Const SQL_CA_CONSTRAINT_INITIALLY_DEFERRED = &H00000010
1256Const SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE = &H00000020
1257Const SQL_CA_CONSTRAINT_DEFERRABLE = &H00000040
1258Const SQL_CA_CONSTRAINT_NON_DEFERRABLE = &H00000080
1259
1260/* SQL_CREATE_CHARACTER_SET bitmasks */
1261Const SQL_CCS_CREATE_CHARACTER_SET = &H00000001
1262Const SQL_CCS_COLLATE_CLAUSE = &H00000002
1263Const SQL_CCS_LIMITED_COLLATION = &H00000004
1264
1265/* SQL_CREATE_COLLATION bitmasks */
1266Const SQL_CCOL_CREATE_COLLATION = &H00000001
1267
1268/* SQL_CREATE_DOMAIN bitmasks */
1269Const SQL_CDO_CREATE_DOMAIN = &H00000001
1270Const SQL_CDO_DEFAULT = &H00000002
1271Const SQL_CDO_CONSTRAINT = &H00000004
1272Const SQL_CDO_COLLATION = &H00000008
1273Const SQL_CDO_CONSTRAINT_NAME_DEFINITION = &H00000010
1274Const SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED = &H00000020
1275Const SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE = &H00000040
1276Const SQL_CDO_CONSTRAINT_DEFERRABLE = &H00000080
1277Const SQL_CDO_CONSTRAINT_NON_DEFERRABLE = &H00000100
1278
1279/* SQL_CREATE_TABLE bitmasks */
1280Const SQL_CT_CREATE_TABLE = &H00000001
1281Const SQL_CT_COMMIT_PRESERVE = &H00000002
1282Const SQL_CT_COMMIT_DELETE = &H00000004
1283Const SQL_CT_GLOBAL_TEMPORARY = &H00000008
1284Const SQL_CT_LOCAL_TEMPORARY = &H00000010
1285Const SQL_CT_CONSTRAINT_INITIALLY_DEFERRED = &H00000020
1286Const SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE = &H00000040
1287Const SQL_CT_CONSTRAINT_DEFERRABLE = &H00000080
1288Const SQL_CT_CONSTRAINT_NON_DEFERRABLE = &H00000100
1289Const SQL_CT_COLUMN_CONSTRAINT = &H00000200
1290Const SQL_CT_COLUMN_DEFAULT = &H00000400
1291Const SQL_CT_COLUMN_COLLATION = &H00000800
1292Const SQL_CT_TABLE_CONSTRAINT = &H00001000
1293Const SQL_CT_CONSTRAINT_NAME_DEFINITION = &H00002000
1294
1295/* SQL_DDL_INDEX bitmasks */
1296Const SQL_DI_CREATE_INDEX = &H00000001
1297Const SQL_DI_DROP_INDEX = &H00000002
1298
1299/* SQL_DROP_COLLATION bitmasks */
1300Const SQL_DC_DROP_COLLATION = &H00000001
1301
1302/* SQL_DROP_DOMAIN bitmasks */
1303Const SQL_DD_DROP_DOMAIN = &H00000001
1304Const SQL_DD_RESTRICT = &H00000002
1305Const SQL_DD_CASCADE = &H00000004
1306
1307/* SQL_DROP_SCHEMA bitmasks */
1308Const SQL_DS_DROP_SCHEMA = &H00000001
1309Const SQL_DS_RESTRICT = &H00000002
1310Const SQL_DS_CASCADE = &H00000004
1311
1312/* SQL_DROP_CHARACTER_SET bitmasks */
1313Const SQL_DCS_DROP_CHARACTER_SET = &H00000001
1314
1315/* SQL_DROP_ASSERTION bitmasks */
1316Const SQL_DA_DROP_ASSERTION = &H00000001
1317
1318/* SQL_DROP_TABLE bitmasks */
1319Const SQL_DT_DROP_TABLE = &H00000001
1320Const SQL_DT_RESTRICT = &H00000002
1321Const SQL_DT_CASCADE = &H00000004
1322
1323/* SQL_DROP_TRANSLATION bitmasks */
1324Const SQL_DTR_DROP_TRANSLATION = &H00000001
1325
1326/* SQL_DROP_VIEW bitmasks */
1327Const SQL_DV_DROP_VIEW = &H00000001
1328Const SQL_DV_RESTRICT = &H00000002
1329Const SQL_DV_CASCADE = &H00000004
1330
1331/* SQL_INSERT_STATEMENT bitmasks */
1332Const SQL_IS_INSERT_LITERALS = &H00000001
1333Const SQL_IS_INSERT_SEARCHED = &H00000002
1334Const SQL_IS_SELECT_INTO = &H00000004
1335
1336/* SQL_ODBC_INTERFACE_CONFORMANCE values */
1337Const SQL_OIC_CORE = 1
1338Const SQL_OIC_LEVEL1 = 2
1339Const SQL_OIC_LEVEL2 = 3
1340
1341/* SQL_SQL92_FOREIGN_KEY_DELETE_RULE bitmasks */
1342Const SQL_SFKD_CASCADE = &H00000001
1343Const SQL_SFKD_NO_ACTION = &H00000002
1344Const SQL_SFKD_SET_DEFAULT = &H00000004
1345Const SQL_SFKD_SET_NULL = &H00000008
1346
1347/* SQL_SQL92_FOREIGN_KEY_UPDATE_RULE bitmasks */
1348Const SQL_SFKU_CASCADE = &H00000001
1349Const SQL_SFKU_NO_ACTION = &H00000002
1350Const SQL_SFKU_SET_DEFAULT = &H00000004
1351Const SQL_SFKU_SET_NULL = &H00000008
1352
1353/* SQL_SQL92_GRANT bitmasks */
1354Const SQL_SG_USAGE_ON_DOMAIN = &H00000001
1355Const SQL_SG_USAGE_ON_CHARACTER_SET = &H00000002
1356Const SQL_SG_USAGE_ON_COLLATION = &H00000004
1357Const SQL_SG_USAGE_ON_TRANSLATION = &H00000008
1358Const SQL_SG_WITH_GRANT_OPTION = &H00000010
1359Const SQL_SG_DELETE_TABLE = &H00000020
1360Const SQL_SG_INSERT_TABLE = &H00000040
1361Const SQL_SG_INSERT_COLUMN = &H00000080
1362Const SQL_SG_REFERENCES_TABLE = &H00000100
1363Const SQL_SG_REFERENCES_COLUMN = &H00000200
1364Const SQL_SG_SELECT_TABLE = &H00000400
1365Const SQL_SG_UPDATE_TABLE = &H00000800
1366Const SQL_SG_UPDATE_COLUMN = &H00001000
1367
1368/* SQL_SQL92_PREDICATES bitmasks */
1369Const SQL_SP_EXISTS = &H00000001
1370Const SQL_SP_ISNOTNULL = &H00000002
1371Const SQL_SP_ISNULL = &H00000004
1372Const SQL_SP_MATCH_FULL = &H00000008
1373Const SQL_SP_MATCH_PARTIAL = &H00000010
1374Const SQL_SP_MATCH_UNIQUE_FULL = &H00000020
1375Const SQL_SP_MATCH_UNIQUE_PARTIAL = &H00000040
1376Const SQL_SP_OVERLAPS = &H00000080
1377Const SQL_SP_UNIQUE = &H00000100
1378Const SQL_SP_LIKE = &H00000200
1379Const SQL_SP_IN = &H00000400
1380Const SQL_SP_BETWEEN = &H00000800
1381Const SQL_SP_COMPARISON = &H00001000
1382Const SQL_SP_QUANTIFIED_COMPARISON = &H00002000
1383
1384/* SQL_SQL92_RELATIONAL_JOIN_OPERATORS bitmasks */
1385Const SQL_SRJO_CORRESPONDING_CLAUSE = &H00000001
1386Const SQL_SRJO_CROSS_JOIN = &H00000002
1387Const SQL_SRJO_EXCEPT_JOIN = &H00000004
1388Const SQL_SRJO_FULL_OUTER_JOIN = &H00000008
1389Const SQL_SRJO_INNER_JOIN = &H00000010
1390Const SQL_SRJO_INTERSECT_JOIN = &H00000020
1391Const SQL_SRJO_LEFT_OUTER_JOIN = &H00000040
1392Const SQL_SRJO_NATURAL_JOIN = &H00000080
1393Const SQL_SRJO_RIGHT_OUTER_JOIN = &H00000100
1394Const SQL_SRJO_UNION_JOIN = &H00000200
1395
1396/* SQL_SQL92_REVOKE bitmasks */
1397Const SQL_SR_USAGE_ON_DOMAIN = &H00000001
1398Const SQL_SR_USAGE_ON_CHARACTER_SET = &H00000002
1399Const SQL_SR_USAGE_ON_COLLATION = &H00000004
1400Const SQL_SR_USAGE_ON_TRANSLATION = &H00000008
1401Const SQL_SR_GRANT_OPTION_FOR = &H00000010
1402Const SQL_SR_CASCADE = &H00000020
1403Const SQL_SR_RESTRICT = &H00000040
1404Const SQL_SR_DELETE_TABLE = &H00000080
1405Const SQL_SR_INSERT_TABLE = &H00000100
1406Const SQL_SR_INSERT_COLUMN = &H00000200
1407Const SQL_SR_REFERENCES_TABLE = &H00000400
1408Const SQL_SR_REFERENCES_COLUMN = &H00000800
1409Const SQL_SR_SELECT_TABLE = &H00001000
1410Const SQL_SR_UPDATE_TABLE = &H00002000
1411Const SQL_SR_UPDATE_COLUMN = &H00004000
1412
1413/* SQL_SQL92_ROW_VALUE_CONSTRUCTOR bitmasks */
1414Const SQL_SRVC_VALUE_EXPRESSION = &H00000001
1415Const SQL_SRVC_NULL = &H00000002
1416Const SQL_SRVC_DEFAULT = &H00000004
1417Const SQL_SRVC_ROW_SUBQUERY = &H00000008
1418
1419/* SQL_SQL92_VALUE_EXPRESSIONS bitmasks */
1420Const SQL_SVE_CASE = &H00000001
1421Const SQL_SVE_CAST = &H00000002
1422Const SQL_SVE_COALESCE = &H00000004
1423Const SQL_SVE_NULLIF = &H00000008
1424
1425/* SQL_STANDARD_CLI_CONFORMANCE bitmasks */
1426Const SQL_SCC_XOPEN_CLI_VERSION1 = &H00000001
1427Const SQL_SCC_ISO92_CLI = &H00000002
1428
1429/* SQL_UNION_STATEMENT bitmasks */
1430Const SQL_US_UNION = SQL_U_UNION
1431Const SQL_US_UNION_ALL = SQL_U_UNION_ALL
1432
1433
1434
1435/* SQL_DTC_TRANSITION_COST bitmasks */
1436Const SQL_DTC_ENLIST_EXPENSIVE = &H00000001
1437Const SQL_DTC_UNENLIST_EXPENSIVE = &H00000002
1438
1439/* additional SQLDataSources fetch directions */
1440Const SQL_FETCH_FIRST_USER = 31
1441Const SQL_FETCH_FIRST_SYSTEM = 32
1442
1443
1444
1445/* Defines for SQLSetPos */
1446Const SQL_ENTIRE_ROWSET = 0
1447
1448/* Operations in SQLSetPos */
1449Const SQL_POSITION = 0 /* 1.0 FALSE */
1450Const SQL_REFRESH = 1 /* 1.0 TRUE */
1451Const SQL_UPDATE = 2
1452Const SQL_DELETE = 3
1453
1454/* Operations in SQLBulkOperations */
1455Const SQL_ADD = 4
1456Const SQL_SETPOS_MAX_OPTION_VALUE = SQL_ADD
1457Const SQL_UPDATE_BY_BOOKMARK = 5
1458Const SQL_DELETE_BY_BOOKMARK = 6
1459Const SQL_FETCH_BY_BOOKMARK = 7
1460
1461
1462/* Lock options in SQLSetPos */
1463Const SQL_LOCK_NO_CHANGE = 0 /* 1.0 FALSE */
1464Const SQL_LOCK_EXCLUSIVE = 1 /* 1.0 TRUE */
1465Const SQL_LOCK_UNLOCK = 2
1466
1467Const SQL_SETPOS_MAX_LOCK_VALUE = SQL_LOCK_UNLOCK
1468
1469/* Macros for SQLSetPos */
1470#define SQL_POSITION_TO(hstmt,irow) SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE)
1471#define SQL_LOCK_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_POSITION,fLock)
1472#define SQL_REFRESH_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_REFRESH,fLock)
1473#define SQL_UPDATE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE)
1474#define SQL_DELETE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE)
1475#define SQL_ADD_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE)
1476
1477/* Column types and scopes in SQLSpecialColumns. */
1478Const SQL_BEST_ROWID = 1
1479Const SQL_ROWVER = 2
1480
1481/* Defines for SQLSpecialColumns (returned in the result set)
1482 SQL_PC_UNKNOWN and SQL_PC_PSEUDO are defined in sql.h */
1483Const SQL_PC_NOT_PSEUDO = 1
1484
1485/* Defines for SQLStatistics */
1486Const SQL_QUICK = 0
1487Const SQL_ENSURE = 1
1488
1489/* Defines for SQLStatistics (returned in the result set)
1490 SQL_INDEX_CLUSTERED, SQL_INDEX_HASHED, and SQL_INDEX_OTHER are
1491 defined in sql.h */
1492Const SQL_TABLE_STAT = 0
1493
1494
1495/* Defines for SQLTables */
1496Const SQL_ALL_CATALOGS = "%"
1497Const SQL_ALL_SCHEMAS = "%"
1498Const SQL_ALL_TABLE_TYPES = "%"
1499
1500
1501/* Options for SQLDriverConnect */
1502Const SQL_DRIVER_NOPROMPT = 0
1503Const SQL_DRIVER_COMPLETE = 1
1504Const SQL_DRIVER_PROMPT = 2
1505Const SQL_DRIVER_COMPLETE_REQUIRED = 3
1506
1507
1508Declare Function SQLDriverConnect Lib "odbc32.dll" (
1509 hdbc As SQLHDBC,
1510 hwnd As HWND,
1511 szConnStrIn As *SQLCHAR,
1512 cbConnStrIn As SQLSMALLINT,
1513 szConnStrOut As *SQLCHAR,
1514 cbConnStrOutMax As SQLSMALLINT,
1515 ByRef pcbConnStrOut As SQLSMALLINT,
1516 fDriverCompletion As SQLUSMALLINT) As SQLRETURN
1517
1518
1519/* Level 2 Functions */
1520
1521/* SQLExtendedFetch "fFetchType" values */
1522Const SQL_FETCH_BOOKMARK = 8
1523
1524/* SQLExtendedFetch "rgfRowStatus" element values */
1525Const SQL_ROW_SUCCESS = 0
1526Const SQL_ROW_DELETED = 1
1527Const SQL_ROW_UPDATED = 2
1528Const SQL_ROW_NOROW = 3
1529Const SQL_ROW_ADDED = 4
1530Const SQL_ROW_ERROR = 5
1531Const SQL_ROW_SUCCESS_WITH_INFO = 6
1532Const SQL_ROW_PROCEED = 0
1533Const SQL_ROW_IGNORE = 1
1534
1535/* value for SQL_DESC_ARRAY_STATUS_PTR */
1536Const SQL_PARAM_SUCCESS = 0
1537Const SQL_PARAM_SUCCESS_WITH_INFO = 6
1538Const SQL_PARAM_ERROR = 5
1539Const SQL_PARAM_UNUSED = 7
1540Const SQL_PARAM_DIAG_UNAVAILABLE = 1
1541
1542Const SQL_PARAM_PROCEED = 0
1543Const SQL_PARAM_IGNORE = 1
1544
1545
1546/* Defines for SQLForeignKeys (UPDATE_RULE and DELETE_RULE) */
1547Const SQL_CASCADE = 0
1548Const SQL_RESTRICT = 1
1549Const SQL_SET_NULL = 2
1550Const SQL_NO_ACTION = 3
1551Const SQL_SET_DEFAULT = 4
1552
1553/* Note that the following are in a different column of SQLForeignKeys than */
1554/* the previous #defines. These are for DEFERRABILITY. */
1555
1556Const SQL_INITIALLY_DEFERRED = 5
1557Const SQL_INITIALLY_IMMEDIATE = 6
1558Const SQL_NOT_DEFERRABLE = 7
1559
1560
1561/* Defines for SQLProcedures (returned in the result set) */
1562Const SQL_PT_UNKNOWN = 0
1563Const SQL_PT_PROCEDURE = 1
1564Const SQL_PT_FUNCTION = 2
1565
1566
1567Declare Function SQLBrowseConnect Lib "odbc32.dll" (
1568 hdbc As SQLHDBC,
1569 szConnStrIn As *SQLCHAR,
1570 cbConnStrIn As SQLSMALLINT,
1571 szConnStrOut As *SQLCHAR,
1572 cbConnStrOutMax As SQLSMALLINT,
1573 ByRef pcbConnStrOut As SQLSMALLINT) As SQLRETURN
1574
1575Declare Function SQLBulkOperations Lib "odbc32.dll" (
1576 StatementHandle As SQLHSTMT,
1577 Operation As SQLSMALLINT) As SQLRETURN
1578
1579
1580Declare Function SQLColAttributes Lib "odbc32.dll" (
1581 hstmt As SQLHSTMT,
1582 icol As SQLUSMALLINT,
1583 fDescType As SQLUSMALLINT,
1584 rgbDesc As SQLPOINTER,
1585 cbDescMax As SQLSMALLINT,
1586 ByRef cbDesc As SQLSMALLINT,
1587 ByRef fDesc As SQLLEN) As SQLRETURN
1588
1589Declare Function SQLColumnPrivileges Lib "odbc32.dll" (
1590 hstmt As SQLHSTMT,
1591 szCatalogName As *SQLCHAR,
1592 cbCatalogName As SQLSMALLINT,
1593 szSchemaName As *SQLCHAR,
1594 cbSchemaName As SQLSMALLINT,
1595 szTableName As *SQLCHAR,
1596 cbTableName As SQLSMALLINT,
1597 szColumnName As *SQLCHAR,
1598 cbColumnName As SQLSMALLINT) As SQLRETURN
1599
1600Declare Function SQLDescribeParam Lib "odbc32.dll" (
1601 hstmt As SQLHSTMT,
1602 ipar As SQLUSMALLINT,
1603 pfSqlType As *SQLSMALLINT,
1604 pcbParamDef As *SQLULEN,
1605 pibScale As *SQLSMALLINT,
1606 pfNullable As *SQLSMALLINT) As SQLRETURN
1607
1608Declare Function SQLExtendedFetch Lib "odbc32.dll" (
1609 hstmt As SQLHSTMT,
1610 fFetchType As SQLUSMALLINT,
1611 irow As SQLLEN,
1612 pcrow As *SQLULEN,
1613 rgfRowStatus As *SQLUSMALLINT) As SQLRETURN
1614
1615Declare Function SQLForeignKeys Lib "odbc32.dll" (
1616 hstmt As SQLHSTMT,
1617 szPkCatalogName As *SQLCHAR,
1618 cbPkCatalogName As SQLSMALLINT,
1619 szPkSchemaName As *SQLCHAR,
1620 cbPkSchemaName As SQLSMALLINT,
1621 szPkTableName As *SQLCHAR,
1622 cbPkTableName As SQLSMALLINT,
1623 szFkCatalogName As *SQLCHAR,
1624 cbFkCatalogName As SQLSMALLINT,
1625 szFkSchemaName As *SQLCHAR,
1626 cbFkSchemaName As SQLSMALLINT,
1627 szFkTableName As *SQLCHAR,
1628 cbFkTableName As SQLSMALLINT) As SQLRETURN
1629
1630Declare Function SQLMoreResults Lib "odbc32.dll" (
1631 hstmt As SQLHSTMT) As SQLRETURN
1632
1633Declare Function SQLNativeSql Lib "odbc32.dll" (
1634 hdbc As SQLHDBC,
1635 szSqlStrIn As *SQLCHAR,
1636 cbSqlStrIn As SQLINTEGER,
1637 szSqlStr As *SQLCHAR,
1638 cbSqlStrMax As SQLINTEGER,
1639 pcbSqlStr As *SQLINTEGER) As SQLRETURN
1640
1641Declare Function SQLNumParams Lib "odbc32.dll" (
1642 hstmt As SQLHSTMT,
1643 pcpar As *SQLSMALLINT) As SQLRETURN
1644
1645Declare Function SQLParamOptions Lib "odbc32.dll" (
1646 hstmt As SQLHSTMT,
1647 crow As SQLULEN,
1648 pirow As *SQLULEN) As SQLRETURN
1649
1650Declare Function SQLPrimaryKeys Lib "odbc32.dll" (
1651 hstmt As SQLHSTMT,
1652 szCatalogName As *SQLCHAR,
1653 cbCatalogName As SQLSMALLINT,
1654 szSchemaName As *SQLCHAR,
1655 cbSchemaName As SQLSMALLINT,
1656 szTableName As *SQLCHAR,
1657 cbTableName As SQLSMALLINT) As SQLRETURN
1658
1659Declare Function SQLProcedureColumns Lib "odbc32.dll" (
1660 hstmt As SQLHSTMT,
1661 szCatalogName As *SQLCHAR,
1662 cbCatalogName As SQLSMALLINT,
1663 szSchemaName As *SQLCHAR,
1664 cbSchemaName As SQLSMALLINT,
1665 szProcName As *SQLCHAR,
1666 cbProcName As SQLSMALLINT,
1667 szColumnName As *SQLCHAR,
1668 cbColumnName As SQLSMALLINT) As SQLRETURN
1669
1670Declare Function SQLProcedures Lib "odbc32.dll" (
1671 hstmt As SQLHSTMT,
1672 szCatalogName As *SQLCHAR,
1673 cbCatalogName As SQLSMALLINT,
1674 szSchemaName As *SQLCHAR,
1675 cbSchemaName As SQLSMALLINT,
1676 szProcName As *SQLCHAR,
1677 cbProcName As SQLSMALLINT) As SQLRETURN
1678
1679
1680
1681Declare Function SQLSetPos Lib "odbc32.dll" (
1682 hstmt As SQLHSTMT,
1683 irow As SQLSETPOSIROW,
1684 fOption As SQLUSMALLINT,
1685 fLock As SQLUSMALLINT) As SQLRETURN
1686
1687Declare Function SQLTablePrivileges Lib "odbc32.dll" (
1688 hstmt As SQLHSTMT,
1689 szCatalogName As *SQLCHAR,
1690 cbCatalogName As SQLSMALLINT,
1691 szSchemaName As *SQLCHAR,
1692 cbSchemaName As SQLSMALLINT,
1693 szTableName As *SQLCHAR,
1694 cbTableName As SQLSMALLINT) As SQLRETURN
1695
1696Declare Function SQLDrivers Lib "odbc32.dll" (
1697 henv As SQLHENV,
1698 fDirection As SQLUSMALLINT,
1699 szDriverDesc As *SQLCHAR,
1700 cbDriverDescMax As SQLSMALLINT,
1701 pcbDriverDesc As *SQLSMALLINT,
1702 szDriverAttributes As *SQLCHAR,
1703 cbDrvrAttrMax As SQLSMALLINT,
1704 pcbDrvrAttr As *SQLSMALLINT) As SQLRETURN
1705
1706Declare Function SQLBindParameter Lib "odbc32.dll" (
1707 hstmt As SQLHSTMT,
1708 ipar As SQLUSMALLINT,
1709 fParamType As SQLSMALLINT,
1710 fCType As SQLSMALLINT,
1711 fSqlType As SQLSMALLINT,
1712 cbColDef As SQLULEN,
1713 ibScale As SQLSMALLINT,
1714 rgbValue As SQLPOINTER,
1715 cbValueMax As SQLLEN,
1716 pcbValue As *SQLLEN) As SQLRETURN
1717
1718
1719
1720
1721
1722Declare Function SQLAllocHandleStd Lib "odbc32.dll" (
1723 fHandleType As SQLSMALLINT,
1724 hInput As SQLHANDLE,
1725 phOutput As *SQLHANDLE) As SQLRETURN
1726
1727/* Deprecated defines from prior versions of ODBC */
1728Const SQL_DATABASE_NAME = 16 /* Use SQLGetConnectOption/SQL_CURRENT_QUALIFIER */
1729Const SQL_FD_FETCH_PREV = SQL_FD_FETCH_PRIOR
1730Const SQL_FETCH_PREV = SQL_FETCH_PRIOR
1731Const SQL_CONCUR_TIMESTAMP = SQL_CONCUR_ROWVER
1732Const SQL_SCCO_OPT_TIMESTAMP = SQL_SCCO_OPT_ROWVER
1733Const SQL_CC_DELETE = SQL_CB_DELETE
1734Const SQL_CR_DELETE = SQL_CB_DELETE
1735Const SQL_CC_CLOSE = SQL_CB_CLOSE
1736Const SQL_CR_CLOSE = SQL_CB_CLOSE
1737Const SQL_CC_PRESERVE = SQL_CB_PRESERVE
1738Const SQL_CR_PRESERVE = SQL_CB_PRESERVE
1739/* SQL_FETCH_RESUME is not supported by 2.0+ drivers
1740Const SQL_FETCH_RESUME = 7
1741*/
1742Const SQL_SCROLL_FORWARD_ONLY = 0 /*-SQL_CURSOR_FORWARD_ONLY */
1743Const SQL_SCROLL_KEYSET_DRIVEN = (-1) /*-SQL_CURSOR_KEYSET_DRIVEN */
1744Const SQL_SCROLL_DYNAMIC = (-2) /*-SQL_CURSOR_DYNAMIC */
1745Const SQL_SCROLL_STATIC = (-3) /*-SQL_CURSOR_STATIC */
1746
1747
1748Declare Function SQLSetScrollOptions Lib "odbc32.dll" ( /* Use SQLSetStmtOptions */
1749 hstmt As SQLHSTMT,
1750 fConcurrency As SQLUSMALLINT,
1751 crowKeyset As SQLLEN,
1752 crowRowset As SQLUSMALLINT) As SQLRETURN
1753
1754
1755
1756/* Functions for setting the connection pooling failure detection code */
1757/* The "TryWait" value is the time (in seconds) that the DM will wait */
1758/* between detecting that a connection is dead (using */
1759/* SQL_ATTR_CONNECTION_DEAD) and retrying the connection. During that */
1760/* interval, connection requests will get "The server appears to be */
1761/* dead" error returns. */
1762
1763
1764Declare Function ODBCSetTryWaitValue Lib "odbc32.dll" (dwValue As DWORD) As BOOL /* In seconds */
1765Declare Function ODBCGetTryWaitValue Lib "odbc32.dll" () As DWord /* In Milliseconds(!) */
1766
1767
1768/* the flags in ODBC_VS_ARGS */
1769Const ODBC_VS_FLAG_UNICODE_ARG = &H00000001 /* the argument is unicode */
1770Const ODBC_VS_FLAG_UNICODE_COR = &H00000002 /* the correlation is unicode */
1771Const ODBC_VS_FLAG_RETCODE = &H00000004 /* RetCode field is set */
1772Const ODBC_VS_FLAG_STOP = &H00000008 /* Stop firing visual studio analyzer events */
1773
1774TypeDef RETCODE = Integer
1775Type ODBC_VS_ARGS
1776 pguidEvent As *GUID
1777 dwFlags As DWord
1778 'Union
1779 'wszArg As *WCHAR
1780 szArg As LPSTR
1781 'End Union
1782 'Union
1783 'wszCorrelation As *WCHAR
1784 szCorrelation As LPSTR
1785 'End Union
1786 RetCode As RETCODE
1787End Type
Note: See TracBrowser for help on using the repository browser.