source: Include/api_sqlext.sbp@ 195

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