1 /***********************************************************************\
2 *                                sqlext.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                                                                       *
8 *                       Placed into public domain                       *
9 \***********************************************************************/
10 module windows.sqlext;
11 nothrow:
12 /* Conversion notes:
13    The MinGW file was a horrible mess. All of the #defines were sorted alphabetically,
14    which is crazy. This file needs a lot of work.
15    In MinGW, sqlext #includes sqlucode, but sqlucode #includes sqlext,
16    creating a circular dependency!
17 */
18 
19 public import windows.sql;
20 private import windows.windef;
21 
22 const SQL_SPEC_MAJOR = 3;
23 const SQL_SPEC_MINOR = 51;
24 const char[] SQL_SPEC_STRING = "03.51";
25 const SQL_ACCESS_MODE = 101;
26 const SQL_ACTIVE_CONNECTIONS = 0;
27 const SQL_ACTIVE_STATEMENTS  = 1;
28 
29 const SQL_DATE = 9;
30 const SQL_TIME = 10;
31 const SQL_SIGNED_OFFSET = -20;
32 const SQL_TINYINT = -6;
33 const SQL_TIMESTAMP = 11;
34 const SQL_UNSIGNED_OFFSET = -22;
35 
36 const SQL_ADD = 4;
37 const SQL_ALL_EXCEPT_LIKE = 2;
38 
39 const SQL_API_ALL_FUNCTIONS       =   0;
40 const SQL_API_SQLCOLATTRIBUTES    =   6;
41 const SQL_API_SQLDRIVERCONNECT    =  41;
42 const SQL_API_SQLBROWSECONNECT    =  55;
43 const SQL_API_SQLCOLUMNPRIVILEGES =  56;
44 const SQL_API_SQLDESCRIBEPARAM    =  58;
45 const SQL_API_SQLEXTENDEDFETCH    =  59;
46 const SQL_API_SQLFOREIGNKEYS      =  60;
47 const SQL_API_SQLMORERESULTS      =  61;
48 const SQL_API_SQLNATIVESQL        =  62;
49 const SQL_API_SQLNUMPARAMS        =  63;
50 const SQL_API_SQLPARAMOPTIONS     =  64;
51 const SQL_API_SQLPRIMARYKEYS      =  65;
52 const SQL_API_SQLPROCEDURECOLUMNS =  66;
53 const SQL_API_SQLPROCEDURES       =  67;
54 const SQL_API_SQLSETPOS           =  68;
55 const SQL_API_SQLSETSCROLLOPTIONS =  69;
56 const SQL_API_SQLTABLEPRIVILEGES  =  70;
57 const SQL_API_SQLDRIVERS          =  71;
58 const SQL_API_SQLBINDPARAMETER    =  72;
59 const SQL_API_LOADBYORDINAL       = 199;
60 
61 const SQL_ASYNC_ENABLE = 4;
62 const SQL_ASYNC_ENABLE_OFF = 0UL;
63 const SQL_ASYNC_ENABLE_ON = 1UL;
64 const SQL_ASYNC_ENABLE_DEFAULT = SQL_ASYNC_ENABLE_OFF;
65 
66 const SQL_ATTR_CONNECTION_DEAD = 1209;
67 const SQL_ATTR_READONLY = 0;
68 const SQL_ATTR_READWRITE_UNKNOWN = 2;
69 const SQL_ATTR_WRITE = 1;
70 
71 const SQL_AUTOCOMMIT = 102;
72 const SQL_AUTOCOMMIT_OFF = 0UL;
73 const SQL_AUTOCOMMIT_ON = 1UL;
74 const SQL_AUTOCOMMIT_DEFAULT = SQL_AUTOCOMMIT_ON;
75 const SQL_BEST_ROWID = 1;
76 const SQL_BIGINT = -5;
77 const SQL_BINARY = -2;
78 const SQL_BIND_BY_COLUMN = 0UL;
79 const SQL_BIND_TYPE = 5;
80 const SQL_BIND_TYPE_DEFAULT = SQL_BIND_BY_COLUMN;
81 const SQL_BIT = -7;
82 
83 const SQL_BOOKMARK_PERSISTENCE = 82;
84 
85 // for BOOKMARK_PERSISTENCE
86 const SQL_BP_CLOSE       = 1;
87 const SQL_BP_DELETE      = 2;
88 const SQL_BP_DROP        = 4;
89 const SQL_BP_TRANSACTION = 8;
90 const SQL_BP_UPDATE      = 16;
91 const SQL_BP_OTHER_HSTMT = 32;
92 const SQL_BP_SCROLL      = 64;
93 
94 const SQL_C_BINARY    = SQL_BINARY;
95 const SQL_C_BIT       = SQL_BIT;
96 const SQL_C_CHAR      = SQL_CHAR;
97 const SQL_C_DATE      = SQL_DATE;
98 const SQL_C_DOUBLE    = SQL_DOUBLE;
99 const SQL_C_FLOAT     = SQL_REAL;
100 const SQL_C_LONG      = SQL_INTEGER;
101 const SQL_C_SHORT     = SQL_SMALLINT;
102 const SQL_C_SLONG     = SQL_C_LONG+SQL_SIGNED_OFFSET;
103 const SQL_C_SSHORT    = SQL_C_SHORT+SQL_SIGNED_OFFSET;
104 const SQL_C_STINYINT  = SQL_TINYINT+SQL_SIGNED_OFFSET;
105 const SQL_C_TIME      = SQL_TIME;
106 const SQL_C_TIMESTAMP = SQL_TIMESTAMP;
107 const SQL_C_TINYINT   = SQL_TINYINT;
108 const SQL_C_ULONG     = SQL_C_LONG+SQL_UNSIGNED_OFFSET;
109 const SQL_C_USHORT    = SQL_C_SHORT+SQL_UNSIGNED_OFFSET;
110 const SQL_C_UTINYINT  = SQL_TINYINT+SQL_UNSIGNED_OFFSET;
111 const SQL_C_BOOKMARK  = SQL_C_ULONG;
112 const SQL_C_DEFAULT   = 99;
113 
114 const SQL_CASCADE = 0;
115 const SQL_CB_NON_NULL = 1;
116 const SQL_CB_NULL = 0;
117 deprecated {
118 const SQL_CC_CLOSE = SQL_CB_CLOSE;/* deprecated */
119 const SQL_CC_DELETE = SQL_CB_DELETE;/* deprecated */
120 const SQL_CC_PRESERVE = SQL_CB_PRESERVE;/* deprecated */
121 }
122 const SQL_CD_FALSE = 0L;
123 const SQL_CD_TRUE = 1L;
124 
125 const SQL_CN_ANY = 2;
126 const SQL_CN_DIFFERENT = 1;
127 const SQL_CN_NONE = 0;
128 
129 const SQL_COLUMN_ALIAS = 87;
130 
131 const SQL_COLUMN_COUNT = 0;
132 const SQL_COLUMN_NAME = 1;
133 const SQL_COLUMN_DISPLAY_SIZE = 6;
134 const SQL_COLUMN_LABEL = 18;
135 const SQL_COLUMN_LENGTH = 3;
136 const SQL_COLUMN_MONEY = 9;
137 const SQL_COLUMN_NULLABLE = 7;
138 const SQL_COLUMN_OWNER_NAME = 16;
139 const SQL_COLUMN_PRECISION = 4;
140 const SQL_COLUMN_QUALIFIER_NAME = 17;
141 const SQL_COLUMN_SCALE = 5;
142 const SQL_COLUMN_UNSIGNED = 8;
143 const SQL_COLUMN_UPDATABLE = 10;
144 const SQL_COLUMN_AUTO_INCREMENT = 11;
145 const SQL_COLUMN_CASE_SENSITIVE = 12;
146 const SQL_COLUMN_SEARCHABLE = 13;
147 const SQL_COLUMN_TYPE = 2;
148 const SQL_COLUMN_TYPE_NAME = 14;
149 const SQL_COLUMN_TABLE_NAME = 15;
150 
151 const SQL_CONCAT_NULL_BEHAVIOR = 22;
152 
153 const SQL_CONCUR_READ_ONLY = 1;
154 const SQL_CONCUR_DEFAULT   = SQL_CONCUR_READ_ONLY;
155 const SQL_CONCUR_LOCK      = 2;
156 const SQL_CONCUR_ROWVER    = 3;
157 const SQL_CONCUR_TIMESTAMP = SQL_CONCUR_ROWVER;/* deprecated */
158 const SQL_CONCUR_VALUES    = 4;
159 
160 const SQL_CONCURRENCY = 7;
161 const SQL_CONVERT_BIGINT = 53;
162 const SQL_CONVERT_BINARY = 54;
163 const SQL_CONVERT_BIT = 55;
164 const SQL_CONVERT_CHAR = 56;
165 const SQL_CONVERT_DATE = 57;
166 const SQL_CONVERT_DECIMAL = 58;
167 const SQL_CONVERT_DOUBLE = 59;
168 const SQL_CONVERT_FLOAT = 60;
169 const SQL_CONVERT_FUNCTIONS = 48;
170 const SQL_CONVERT_INTEGER = 61;
171 const SQL_CONVERT_LONGVARBINARY = 71;
172 const SQL_CONVERT_LONGVARCHAR = 62;
173 const SQL_CONVERT_NUMERIC = 63;
174 const SQL_CONVERT_REAL = 64;
175 const SQL_CONVERT_SMALLINT = 65;
176 const SQL_CONVERT_TIME = 66;
177 const SQL_CONVERT_TIMESTAMP = 67;
178 const SQL_CONVERT_TINYINT = 68;
179 const SQL_CONVERT_VARBINARY = 69;
180 const SQL_CONVERT_VARCHAR = 70;
181 const SQL_CORRELATION_NAME = 74;
182 const SQL_CR_CLOSE = SQL_CB_CLOSE;/* deprecated */
183 const SQL_CR_DELETE = SQL_CB_DELETE;/* deprecated */
184 const SQL_CR_PRESERVE = SQL_CB_PRESERVE;/* deprecated */
185 
186 enum : ULONG {
187 	SQL_CUR_USE_IF_NEEDED = 0,
188 	SQL_CUR_USE_ODBC,
189 	SQL_CUR_USE_DRIVER,
190 	SQL_CUR_DEFAULT = SQL_CUR_USE_DRIVER
191 }
192 
193 const SQL_CURRENT_QUALIFIER = 109;
194 const SQL_CURSOR_DYNAMIC = 2UL;
195 const SQL_CURSOR_FORWARD_ONLY = 0UL;
196 const SQL_CURSOR_KEYSET_DRIVEN = 1UL;
197 const SQL_CURSOR_ROLLBACK_BEHAVIOR = 24;
198 const SQL_CURSOR_STATIC = 3UL;
199 const SQL_CURSOR_TYPE = 6;
200 const SQL_CURSOR_TYPE_DEFAULT = SQL_CURSOR_FORWARD_ONLY;
201 
202 const SQL_CV_CASCADED = 0x00000004L;
203 const SQL_CV_CHECK_OPTION = 0x00000002L;
204 const SQL_CV_CREATE_VIEW = 0x00000001L;
205 const SQL_CV_LOCAL = 0x00000008L;
206 const SQL_CVT_BIGINT = 0x00004000L;
207 const SQL_CVT_BINARY = 0x00000400L;
208 const SQL_CVT_BIT = 0x00001000L;
209 const SQL_CVT_CHAR = 0x00000001L;
210 const SQL_CVT_DATE = 0x00008000L;
211 const SQL_CVT_DECIMAL = 0x00000004L;
212 const SQL_CVT_DOUBLE = 0x00000080L;
213 const SQL_CVT_FLOAT = 0x00000020L;
214 const SQL_CVT_INTEGER = 0x00000008L;
215 const SQL_CVT_LONGVARBINARY = 0x00040000L;
216 const SQL_CVT_LONGVARCHAR = 0x00000200L;
217 const SQL_CVT_NUMERIC = 0x00000002L;
218 const SQL_CVT_REAL = 0x00000040L;
219 const SQL_CVT_SMALLINT = 0x00000010L;
220 const SQL_CVT_TIME = 0x00010000L;
221 const SQL_CVT_TIMESTAMP = 0x00020000L;
222 const SQL_CVT_TINYINT = 0x00002000L;
223 const SQL_CVT_VARBINARY = 0x00000800L;
224 const SQL_CVT_VARCHAR = 0x00000100L;
225 const SQL_DATABASE_NAME = 16;/* deprecated */
226 
227 const SQL_DEFAULT_PARAM = -5;
228 const SQL_DELETE = 3;
229 
230 const SQL_DRIVER_COMPLETE = 1;
231 const SQL_DRIVER_COMPLETE_REQUIRED = 3;
232 const SQL_DRIVER_HDBC = 3;
233 const SQL_DRIVER_HENV = 4;
234 const SQL_DRIVER_HLIB = 76;
235 const SQL_DRIVER_HSTMT = 5;
236 const SQL_DRIVER_NAME = 6;
237 const SQL_DRIVER_NOPROMPT = 0;
238 const SQL_DRIVER_ODBC_VER = 77;
239 const SQL_DRIVER_PROMPT = 2;
240 const SQL_DRIVER_VER = 7;
241 
242 const SQL_DTC_ENLIST_EXPENSIVE = 1;
243 const SQL_DTC_UNENLIST_EXPENSIVE = 2;
244 const SQL_DTC_TRANSITION_COST = 1750;
245 const SQL_ENSURE = 1;
246 const SQL_ENTIRE_ROWSET = 0;
247 const SQL_EXPRESSIONS_IN_ORDERBY = 27;
248 const SQL_FD_FETCH_BOOKMARK = 128;
249 const SQL_FD_FETCH_PREV = SQL_FD_FETCH_PRIOR;/* deprecated */
250 const SQL_FD_FETCH_RESUME = 64;
251 const SQL_FETCH_BOOKMARK = 8;
252 const SQL_FETCH_PREV = SQL_FETCH_PRIOR;/* deprecated */
253 const SQL_FETCH_RESUME = 7;/* deprecated */
254 
255 const SQL_FILE_NOT_SUPPORTED = 0x0000;
256 const SQL_FILE_TABLE = 0x0001;
257 const SQL_FILE_QUALIFIER = 0x0002;
258 const SQL_FILE_CATALOG = SQL_FILE_QUALIFIER;
259 const SQL_FILE_USAGE = 84;
260 
261 const SQL_FN_CVT_CONVERT = 0x00000001L;
262 const SQL_FN_NUM_ABS = 0x00000001L;
263 const SQL_FN_NUM_ACOS = 0x00000002L;
264 const SQL_FN_NUM_ASIN = 0x00000004L;
265 const SQL_FN_NUM_ATAN = 0x00000008L;
266 const SQL_FN_NUM_ATAN2 = 0x00000010L;
267 const SQL_FN_NUM_CEILING = 0x00000020L;
268 const SQL_FN_NUM_COS = 0x00000040L;
269 const SQL_FN_NUM_COT = 0x00000080L;
270 const SQL_FN_NUM_DEGREES = 0x00040000L;
271 const SQL_FN_NUM_EXP = 0x00000100L;
272 const SQL_FN_NUM_FLOOR = 0x00000200L;
273 const SQL_FN_NUM_LOG = 0x00000400L;
274 const SQL_FN_NUM_LOG10 = 0x00080000L;
275 const SQL_FN_NUM_MOD = 0x00000800L;
276 const SQL_FN_NUM_PI = 0x00010000L;
277 const SQL_FN_NUM_POWER = 0x00100000L;
278 const SQL_FN_NUM_RADIANS = 0x00200000L;
279 const SQL_FN_NUM_RAND = 0x00020000L;
280 const SQL_FN_NUM_ROUND = 0x00400000L;
281 const SQL_FN_NUM_SIGN = 0x00001000L;
282 const SQL_FN_NUM_SIN = 0x00002000L;
283 const SQL_FN_NUM_SQRT = 0x00004000L;
284 const SQL_FN_NUM_TAN = 0x00008000L;
285 const SQL_FN_NUM_TRUNCATE = 0x00800000L;
286 const SQL_FN_STR_ASCII = 0x00002000L;
287 const SQL_FN_STR_CHAR = 0x00004000L;
288 const SQL_FN_STR_CONCAT = 0x00000001L;
289 const SQL_FN_STR_DIFFERENCE = 0x00008000L;
290 const SQL_FN_STR_INSERT = 0x00000002L;
291 const SQL_FN_STR_LCASE = 0x00000040L;
292 const SQL_FN_STR_LEFT = 0x00000004L;
293 const SQL_FN_STR_LENGTH = 0x00000010L;
294 const SQL_FN_STR_LOCATE = 0x00000020L;
295 const SQL_FN_STR_LOCATE_2 = 0x00010000L;
296 const SQL_FN_STR_LTRIM = 0x00000008L;
297 const SQL_FN_STR_REPEAT = 0x00000080L;
298 const SQL_FN_STR_REPLACE = 0x00000100L;
299 const SQL_FN_STR_RIGHT = 0x00000200L;
300 const SQL_FN_STR_RTRIM = 0x00000400L;
301 const SQL_FN_STR_SOUNDEX = 0x00020000L;
302 const SQL_FN_STR_SPACE = 0x00040000L;
303 const SQL_FN_STR_SUBSTRING = 0x00000800L;
304 const SQL_FN_STR_UCASE = 0x00001000L;
305 const SQL_FN_SYS_DBNAME = 0x00000002L;
306 const SQL_FN_SYS_IFNULL = 0x00000004L;
307 const SQL_FN_SYS_USERNAME = 0x00000001L;
308 const SQL_FN_TD_CURDATE = 0x00000002L;
309 const SQL_FN_TD_CURTIME = 0x00000200L;
310 const SQL_FN_TD_DAYNAME = 0x00008000L;
311 const SQL_FN_TD_DAYOFMONTH = 0x00000004L;
312 const SQL_FN_TD_DAYOFWEEK = 0x00000008L;
313 const SQL_FN_TD_DAYOFYEAR = 0x00000010L;
314 const SQL_FN_TD_HOUR = 0x00000400L;
315 const SQL_FN_TD_MINUTE = 0x00000800L;
316 const SQL_FN_TD_MONTH = 0x00000020L;
317 const SQL_FN_TD_MONTHNAME = 0x00010000L;
318 const SQL_FN_TD_NOW = 0x00000001L;
319 const SQL_FN_TD_QUARTER = 0x00000040L;
320 const SQL_FN_TD_SECOND = 0x00001000L;
321 const SQL_FN_TD_TIMESTAMPADD = 0x00002000L;
322 const SQL_FN_TD_TIMESTAMPDIFF = 0x00004000L;
323 const SQL_FN_TD_WEEK = 0x00000080L;
324 const SQL_FN_TD_YEAR = 0x00000100L;
325 const SQL_FN_TSI_DAY = 0x00000010L;
326 const SQL_FN_TSI_FRAC_SECOND = 0x00000001L;
327 const SQL_FN_TSI_HOUR = 0x00000008L;
328 const SQL_FN_TSI_MINUTE = 0x00000004L;
329 const SQL_FN_TSI_MONTH = 0x00000040L;
330 const SQL_FN_TSI_QUARTER = 0x00000080L;
331 const SQL_FN_TSI_SECOND = 0x00000002L;
332 const SQL_FN_TSI_WEEK = 0x00000020L;
333 const SQL_FN_TSI_YEAR = 0x00000100L;
334 const SQL_GB_GROUP_BY_CONTAINS_SELECT = 2;
335 const SQL_GB_GROUP_BY_EQUALS_SELECT = 1;
336 const SQL_GB_NO_RELATION = 3;
337 const SQL_GB_NOT_SUPPORTED = 0;
338 const SQL_GD_BLOCK = 4;
339 const SQL_GD_BOUND = 8;
340 const SQL_GET_BOOKMARK = 13;
341 const SQL_GROUP_BY = 88;
342 const SQL_IGNORE = -6;
343 const SQL_INFO_FIRST = 0;
344 const SQL_KEYSET_SIZE = 8;
345 const SQL_KEYSET_SIZE_DEFAULT = 0UL;
346 const SQL_KEYWORDS = 89;
347 const SQL_LCK_EXCLUSIVE = 2;
348 const SQL_LCK_NO_CHANGE = 1;
349 const SQL_LCK_UNLOCK = 4;
350 
351 const SQL_LEN_BINARY_ATTR_OFFSET  = -100;
352 const SQL_LEN_DATA_AT_EXEC_OFFSET = -100;
353 //MACRO #define SQL_LEN_BINARY_ATTR(length) (-(length)+SQL_LEN_BINARY_ATTR_OFFSET)
354 //MACRO #define SQL_LEN_DATA_AT_EXEC(length) (-(length)+SQL_LEN_DATA_AT_EXEC_OFFSET)
355 
356 const SQL_LIKE_ESCAPE_CLAUSE = 113;
357 const SQL_LIKE_ONLY = 1;
358 const SQL_LOCK_EXCLUSIVE = 1;
359 const SQL_LOCK_NO_CHANGE = 0;
360 const SQL_LOCK_TYPES = 78;
361 const SQL_LOCK_UNLOCK = 2;
362 const SQL_LOGIN_TIMEOUT = 103;
363 const SQL_LOGIN_TIMEOUT_DEFAULT = 15UL;
364 const SQL_LONGVARBINARY = -4;
365 const SQL_LONGVARCHAR = -1;
366 const SQL_MAX_BINARY_LITERAL_LEN = 112;
367 const SQL_MAX_CHAR_LITERAL_LEN = 108;
368 const SQL_MAX_DSN_LENGTH = 32;
369 const SQL_MAX_LENGTH = 3;
370 const SQL_MAX_LENGTH_DEFAULT = 0UL;
371 const SQL_MAX_OPTION_STRING_LENGTH = 256;
372 const SQL_MAX_OWNER_NAME_LEN = 32;
373 const SQL_MAX_PROCEDURE_NAME_LEN = 33;
374 const SQL_MAX_QUALIFIER_NAME_LEN = 34;
375 const SQL_MAX_ROW_SIZE_INCLUDES_LONG = 103;
376 const SQL_MAX_ROWS = 1;
377 const SQL_MAX_ROWS_DEFAULT = 0UL;
378 
379 const SQL_MODE_READ_WRITE = 0UL;
380 const SQL_MODE_READ_ONLY = 1UL;
381 const SQL_MODE_DEFAULT = SQL_MODE_READ_WRITE;
382 
383 const SQL_MULT_RESULT_SETS = 36;
384 const SQL_MULTIPLE_ACTIVE_TXN = 37;
385 const SQL_NC_END = 0x0004;
386 const SQL_NC_START = 0x0002;
387 const SQL_NEED_LONG_DATA_LEN = 111;
388 const SQL_NNC_NON_NULL = 0x0001;
389 const SQL_NNC_NULL = 0x0000;
390 const SQL_NO_TOTAL = -4;
391 const SQL_NON_NULLABLE_COLUMNS = 75;
392 
393 const SQL_NOSCAN_OFF = 0UL;
394 const SQL_NOSCAN_ON = 1UL;
395 const SQL_NOSCAN = 2;
396 const SQL_NOSCAN_DEFAULT = SQL_NOSCAN_OFF;
397 
398 const SQL_NUMERIC_FUNCTIONS = 49;
399 const SQL_OAC_LEVEL1 = 0x0001;
400 const SQL_OAC_LEVEL2 = 0x0002;
401 const SQL_OAC_NONE = 0x0000;
402 const SQL_ODBC_API_CONFORMANCE = 9;
403 const SQL_ODBC_CURSORS = 110;
404 const SQL_ODBC_SAG_CLI_CONFORMANCE = 12;
405 const SQL_ODBC_SQL_CONFORMANCE = 15;
406 const SQL_ODBC_SQL_OPT_IEF = 73;
407 const SQL_ODBC_VER = 10;
408 const SQL_OPT_TRACE = 104;
409 
410 const SQL_OPT_TRACE_FILE_DEFAULT = "\\SQL.LOG";
411 const SQL_OPT_TRACE_OFF = 0UL;
412 const SQL_OPT_TRACE_DEFAULT = SQL_OPT_TRACE_OFF;
413 const SQL_OPT_TRACE_ON = 1UL;
414 
415 const SQL_OPT_TRACEFILE = 105;
416 const SQL_OSC_CORE = 1;
417 const SQL_OSC_EXTENDED = 2;
418 const SQL_OSC_MINIMUM = 0;
419 const SQL_OSCC_COMPLIANT = 1;
420 const SQL_OSCC_NOT_COMPLIANT = 0;
421 const SQL_OU_DML_STATEMENTS = 1;
422 const SQL_OU_INDEX_DEFINITION = 8;
423 const SQL_OU_PRIVILEGE_DEFINITION = 16;
424 const SQL_OU_PROCEDURE_INVOCATION = 2;
425 const SQL_OU_TABLE_DEFINITION = 4;
426 const SQL_OUTER_JOINS = 38;
427 const SQL_OWNER_TERM = 39;
428 const SQL_OWNER_USAGE = 91;
429 const SQL_PACKET_SIZE = 112;
430 const SQL_PARAM_INPUT = 1;
431 const SQL_PARAM_INPUT_OUTPUT = 2;
432 const SQL_PARAM_OUTPUT = 4;
433 const SQL_PARAM_TYPE_DEFAULT = SQL_PARAM_INPUT_OUTPUT;
434 const SQL_PARAM_TYPE_UNKNOWN = 0;
435 const SQL_PC_NOT_PSEUDO = 1;
436 const SQL_POS_ADD = 16;
437 const SQL_POS_DELETE = 8;
438 const SQL_POS_OPERATIONS = 79;
439 const SQL_POS_POSITION = 1;
440 const SQL_POS_REFRESH = 2;
441 const SQL_POS_UPDATE = 4;
442 const SQL_POSITION = 0;
443 const SQL_POSITIONED_STATEMENTS = 80;
444 const SQL_PROCEDURE_TERM = 40;
445 const SQL_PROCEDURES = 21;
446 const SQL_PS_POSITIONED_DELETE = 1;
447 const SQL_PS_POSITIONED_UPDATE = 2;
448 const SQL_PS_SELECT_FOR_UPDATE = 4;
449 const SQL_PT_FUNCTION = 2;
450 const SQL_PT_PROCEDURE = 1;
451 const SQL_PT_UNKNOWN = 0;
452 const SQL_QL_END = 0x0002;
453 const SQL_QL_START = 0x0001;
454 const SQL_QU_DML_STATEMENTS = 1;
455 const SQL_QU_INDEX_DEFINITION = 8;
456 const SQL_QU_PRIVILEGE_DEFINITION = 16;
457 const SQL_QU_PROCEDURE_INVOCATION = 2;
458 const SQL_QU_TABLE_DEFINITION = 4;
459 const SQL_QUALIFIER_LOCATION = 114;
460 const SQL_QUALIFIER_NAME_SEPARATOR = 41;
461 const SQL_QUALIFIER_TERM = 42;
462 const SQL_QUALIFIER_USAGE = 92;
463 const SQL_QUERY_TIMEOUT = 0;
464 const SQL_QUERY_TIMEOUT_DEFAULT = 0UL;
465 const SQL_QUICK = 0;
466 const SQL_QUIET_MODE = 111;
467 const SQL_QUOTED_IDENTIFIER_CASE = 93;
468 
469 const SQL_RD_OFF = 0UL;
470 const SQL_RD_ON = 1UL;
471 const SQL_RD_DEFAULT = SQL_RD_ON;
472 
473 const SQL_REFRESH = 1;
474 const SQL_RESTRICT = 1;
475 const SQL_RESULT_COL = 3;
476 const SQL_RETRIEVE_DATA = 11;
477 const SQL_RETURN_VALUE = 5;
478 const SQL_ROW_ADDED = 4;
479 const SQL_ROW_DELETED = 1;
480 const SQL_ROW_ERROR = 5;
481 const SQL_ROW_NOROW = 3;
482 const SQL_ROW_NUMBER = 14;
483 const SQL_ROW_SUCCESS = 0;
484 const SQL_ROW_UPDATED = 2;
485 const SQL_ROW_UPDATES = 11;
486 const SQL_ROWSET_SIZE = 9;
487 const SQL_ROWSET_SIZE_DEFAULT = 1UL;
488 const SQL_ROWVER = 2;
489 const SQL_SC_NON_UNIQUE = 0UL;
490 const SQL_SC_TRY_UNIQUE = 1UL;
491 const SQL_SC_UNIQUE = 2UL;
492 const SQL_SCCO_OPT_TIMESTAMP = SQL_SCCO_OPT_ROWVER;/* deprecated */
493 const SQL_SCROLL_DYNAMIC = -2L;/* deprecated */
494 const SQL_SCROLL_FORWARD_ONLY = 0L;/* deprecated */
495 const SQL_SCROLL_KEYSET_DRIVEN = -1L;/* deprecated */
496 const SQL_SCROLL_OPTIONS = 44;
497 const SQL_SCROLL_STATIC = -3L;/* deprecated */
498 const SQL_SEARCHABLE = 3;
499 const SQL_SET_NULL = 2;
500 const SQL_SETPARAM_VALUE_MAX = -1L;
501 const SQL_SETPOS_MAX_LOCK_VALUE = SQL_LOCK_UNLOCK;
502 const SQL_SETPOS_MAX_OPTION_VALUE = SQL_ADD;
503 const SQL_SIMULATE_CURSOR = 10;
504 const SQL_SO_DYNAMIC = 4;
505 const SQL_SO_FORWARD_ONLY = 1;
506 const SQL_SO_KEYSET_DRIVEN = 2;
507 const SQL_SO_MIXED = 8;
508 const SQL_SO_STATIC = 16;
509 const SQL_SQ_COMPARISON = 1;
510 const SQL_SQ_CORRELATED_SUBQUERIES = 16;
511 const SQL_SQ_EXISTS = 2;
512 const SQL_SQ_IN = 4;
513 const SQL_SQ_QUANTIFIED = 8;
514 const SQL_SQLSTATE_SIZE = 5;
515 const SQL_SS_ADDITIONS = 1;
516 const SQL_SS_DELETIONS = 2;
517 const SQL_SS_UPDATES = 4;
518 const SQL_STATIC_SENSITIVITY = 83;
519 const SQL_STRING_FUNCTIONS = 50;
520 const SQL_SUBQUERIES = 95;
521 const SQL_SYSTEM_FUNCTIONS = 51;
522 const SQL_TABLE_STAT = 0;
523 const SQL_TABLE_TERM = 45;
524 const SQL_TIMEDATE_ADD_INTERVALS = 109;
525 const SQL_TIMEDATE_DIFF_INTERVALS = 110;
526 const SQL_TIMEDATE_FUNCTIONS = 52;
527 const SQL_TRANSLATE_DLL = 106;
528 const SQL_TRANSLATE_OPTION = 107;
529 const SQL_TXN_ISOLATION = 108;
530 const SQL_TXN_VERSIONING = 16;
531 const SQL_TYPE_NULL = 0;
532 const SQL_U_UNION = 1;
533 const SQL_U_UNION_ALL = 2;
534 
535 const SQL_UB_OFF = 0UL;
536 const SQL_UB_DEFAULT = SQL_UB_OFF;
537 const SQL_UB_ON = 01UL;
538 
539 const SQL_UNION = 96;
540 const SQL_UNSEARCHABLE = 0;
541 const SQL_UPDATE = 2;
542 const SQL_USE_BOOKMARKS = 12;
543 const SQL_VARBINARY = -3;
544 
545 const SQL_COLATT_OPT_MAX = SQL_COLUMN_LABEL;
546 const SQL_COLATT_OPT_MIN = SQL_COLUMN_COUNT;
547 const SQL_PRED_SEARCHABLE = SQL_SEARCHABLE;
548 
549 //MACRO #define SQL_POSITION_TO(s, r) SQLSetPos(s, r, SQL_POSITION, SQL_LOCK_NO_CHANGE)
550 
551 //MACRO #define SQL_LOCK_RECORD(s, r, l) SQLSetPos(s, r, SQL_POSITION, l)
552 
553 //MACRO #define SQL_REFRESH_RECORD(s, r, l) SQLSetPos(s, r, SQL_REFRESH, l)
554 
555 //MACRO #define SQL_UPDATE_RECORD(s, r) SQLSetPos(s, r, SQL_UPDATE, SQL_LOCK_NO_CHANGE)
556 
557 //MACRO #define SQL_DELETE_RECORD(s, r) SQLSetPos(s, r, SQL_DELETE, SQL_LOCK_NO_CHANGE)
558 
559 //MACRO #define SQL_ADD_RECORD(s, r) SQLSetPos(s, r, SQL_ADD, SQL_LOCK_NO_CHANGE)
560 
561 
562 static if (ODBCVER < 0x0300) {
563 	const SQL_CONNECT_OPT_DRVR_START = 1000;
564 	const SQL_CONN_OPT_MAX = SQL_PACKET_SIZE;
565 	const SQL_CONN_OPT_MIN = SQL_ACCESS_MODE;
566 	const SQL_STMT_OPT_MAX = SQL_ROW_NUMBER;
567 	const SQL_STMT_OPT_MIN = SQL_QUERY_TIMEOUT;
568 	const SQL_TYPE_DRIVER_START = SQL_INTERVAL_YEAR;
569 	const SQL_TYPE_DRIVER_END = SQL_UNICODE_LONGVARCHAR;
570 	const SQL_TYPE_MIN = SQL_BIT;
571 	const SQL_TYPE_MAX = SQL_VARCHAR;
572 }
573 
574 static if (ODBCVER < 0x0300) {
575 	const SQL_NO_DATA_FOUND = 100;
576 	const SQL_INTERVAL_YEAR = -80;
577 	const SQL_INTERVAL_MONTH = -81;
578 	const SQL_INTERVAL_YEAR_TO_MONTH = -82;
579 	const SQL_INTERVAL_DAY = -83;
580 	const SQL_INTERVAL_HOUR = -84;
581 	const SQL_INTERVAL_MINUTE = -85;
582 	const SQL_INTERVAL_SECOND = -86;
583 	const SQL_INTERVAL_DAY_TO_HOUR = -87;
584 	const SQL_INTERVAL_DAY_TO_MINUTE = -88;
585 	const SQL_INTERVAL_DAY_TO_SECOND = -89;
586 	const SQL_INTERVAL_HOUR_TO_MINUTE = -90;
587 	const SQL_INTERVAL_HOUR_TO_SECOND = -91;
588 	const SQL_INTERVAL_MINUTE_TO_SECOND = -92;
589 } else {
590 	const SQL_NO_DATA_FOUND = SQL_NO_DATA;
591 	const SQL_CODE_YEAR = 1;
592 	const SQL_CODE_MONTH = 2;
593 	const SQL_CODE_DAY = 3;
594 	const SQL_CODE_HOUR = 4;
595 	const SQL_CODE_MINUTE = 5;
596 	const SQL_CODE_SECOND = 6;
597 	const SQL_CODE_YEAR_TO_MONTH = 7;
598 	const SQL_CODE_DAY_TO_HOUR = 8;
599 	const SQL_CODE_DAY_TO_MINUTE = 9;
600 	const SQL_CODE_DAY_TO_SECOND = 10;
601 	const SQL_CODE_HOUR_TO_MINUTE = 11;
602 	const SQL_CODE_HOUR_TO_SECOND = 12;
603 	const SQL_CODE_MINUTE_TO_SECOND = 13;
604 	const SQL_INTERVAL_YEAR = 100 + SQL_CODE_YEAR;
605 	const SQL_INTERVAL_MONTH = 100 + SQL_CODE_MONTH;
606 	const SQL_INTERVAL_DAY = 100 + SQL_CODE_DAY;
607 	const SQL_INTERVAL_HOUR = 100 + SQL_CODE_HOUR;
608 	const SQL_INTERVAL_MINUTE = 100 + SQL_CODE_MINUTE;
609 	const SQL_INTERVAL_SECOND = 100 + SQL_CODE_SECOND;
610 	const SQL_INTERVAL_YEAR_TO_MONTH = 100 + SQL_CODE_YEAR_TO_MONTH;
611 	const SQL_INTERVAL_DAY_TO_HOUR = 100 + SQL_CODE_DAY_TO_HOUR;
612 	const SQL_INTERVAL_DAY_TO_MINUTE = 100 + SQL_CODE_DAY_TO_MINUTE;
613 	const SQL_INTERVAL_DAY_TO_SECOND = 100 + SQL_CODE_DAY_TO_SECOND;
614 	const SQL_INTERVAL_HOUR_TO_MINUTE = 100 + SQL_CODE_HOUR_TO_MINUTE;
615 	const SQL_INTERVAL_HOUR_TO_SECOND = 100 + SQL_CODE_HOUR_TO_SECOND;
616 	const SQL_INTERVAL_MINUTE_TO_SECOND = 100 + SQL_CODE_MINUTE_TO_SECOND;
617 }//[Yes] #endif
618 
619 
620 static if ((ODBCVER >= 0x0201) && (ODBCVER < 0x0300)) {
621 	const SQL_OJ_CAPABILITIES = 65003;
622 }
623 
624 static if (ODBCVER >= 0x0250) {
625 	const SQL_NO_ACTION   = 3;
626 	const SQL_SET_DEFAULT = 4;
627 }
628 
629 static if (ODBCVER >= 0x0300) {
630 	const SQL_ACTIVE_ENVIRONMENTS = 116;
631 	const SQL_AD_ADD_CONSTRAINT_DEFERRABLE = 0x00000080L;
632 	const SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED = 0x00000020L;
633 	const SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE = 0x00000040L;
634 	const SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE = 0x00000100L;
635 	const SQL_AD_ADD_DOMAIN_CONSTRAINT = 0x00000002L;
636 	const SQL_AD_ADD_DOMAIN_DEFAULT = 0x00000008L;
637 	const SQL_AD_CONSTRAINT_NAME_DEFINITION = 0x00000001L;
638 	const SQL_AD_DROP_DOMAIN_CONSTRAINT = 0x00000004L;
639 	const SQL_AD_DROP_DOMAIN_DEFAULT = 0x00000010L;
640 	const SQL_AF_ALL = 0x00000040L;
641 	const SQL_AF_AVG = 0x00000001L;
642 	const SQL_AF_COUNT = 0x00000002L;
643 	const SQL_AF_DISTINCT = 0x00000020L;
644 	const SQL_AF_MAX = 0x00000004L;
645 	const SQL_AF_MIN = 0x00000008L;
646 	const SQL_AF_SUM = 0x00000010L;
647 	const SQL_AGGREGATE_FUNCTIONS = 169;
648 	const SQL_ALL_CATALOGS = "%";
649 	const SQL_ALL_SCHEMAS = "%";
650 	const SQL_ALL_TABLE_TYPES = "%";
651 	const SQL_ALTER_DOMAIN = 117;
652 	const SQL_AM_CONNECTION = 1;
653 	const SQL_AM_NONE = 0;
654 	const SQL_AM_STATEMENT = 2;
655 	const SQL_API_ODBC3_ALL_FUNCTIONS = 999;
656 	const SQL_API_ODBC3_ALL_FUNCTIONS_SIZE = 250;
657 	const SQL_API_SQLALLOCHANDLESTD = 73;
658 	const SQL_API_SQLBULKOPERATIONS = 24;
659 	const SQL_ASYNC_MODE = 10021;
660 	const SQL_AT_ADD_COLUMN_COLLATION = 0x00000080L;
661 	const SQL_AT_ADD_COLUMN_DEFAULT = 0x00000040L;
662 	const SQL_AT_ADD_COLUMN_SINGLE = 0x00000020L;
663 	const SQL_AT_ADD_TABLE_CONSTRAINT = 0x00001000L;
664 	const SQL_AT_CONSTRAINT_DEFERRABLE = 0x00040000L;
665 	const SQL_AT_CONSTRAINT_INITIALLY_DEFERRED = 0x00010000L;
666 	const SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE = 0x00020000L;
667 	const SQL_AT_CONSTRAINT_NAME_DEFINITION = 0x00008000L;
668 	const SQL_AT_CONSTRAINT_NON_DEFERRABLE = 0x00080000L;
669 	const SQL_AT_DROP_COLUMN_CASCADE = 0x00000400L;
670 	const SQL_AT_DROP_COLUMN_DEFAULT = 0x00000200L;
671 	const SQL_AT_DROP_COLUMN_RESTRICT = 0x00000800L;
672 	const SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE = 0x00002000L;
673 	const SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT = 0x00004000L;
674 	const SQL_AT_SET_COLUMN_DEFAULT = 0x00000100L;
675 	const SQL_ATTR_ACCESS_MODE = SQL_ACCESS_MODE;
676 	const SQL_ATTR_ASYNC_ENABLE = 4;
677 	const SQL_ATTR_AUTOCOMMIT = SQL_AUTOCOMMIT;
678 	const SQL_ATTR_CONCURRENCY = SQL_CONCURRENCY;
679 	const SQL_ATTR_CONNECTION_POOLING = 201;
680 	const SQL_ATTR_CONNECTION_TIMEOUT = 113;
681 	const SQL_ATTR_CP_MATCH = 202;
682 	const SQL_ATTR_CURRENT_CATALOG = SQL_CURRENT_QUALIFIER;
683 	const SQL_ATTR_CURSOR_TYPE = SQL_CURSOR_TYPE;
684 	const SQL_ATTR_DISCONNECT_BEHAVIOR = 114;
685 	const SQL_ATTR_ENABLE_AUTO_IPD = 15;
686 	const SQL_ATTR_ENLIST_IN_DTC = 1207;
687 	const SQL_ATTR_ENLIST_IN_XA = 1208;
688 	const SQL_ATTR_FETCH_BOOKMARK_PTR = 16;
689 	const SQL_ATTR_KEYSET_SIZE = SQL_KEYSET_SIZE;
690 	const SQL_ATTR_LOGIN_TIMEOUT = SQL_LOGIN_TIMEOUT;
691 	const SQL_ATTR_MAX_LENGTH = SQL_MAX_LENGTH;
692 	const SQL_ATTR_MAX_ROWS = SQL_MAX_ROWS;
693 	const SQL_ATTR_NOSCAN = SQL_NOSCAN;
694 	const SQL_ATTR_ODBC_CURSORS = SQL_ODBC_CURSORS;
695 	const SQL_ATTR_ODBC_VERSION = 200;
696 	const SQL_ATTR_PACKET_SIZE = SQL_PACKET_SIZE;
697 	const SQL_ATTR_PARAM_BIND_OFFSET_PTR = 17;
698 	const SQL_ATTR_PARAM_BIND_TYPE = 18;
699 	const SQL_ATTR_PARAM_OPERATION_PTR = 19;
700 	const SQL_ATTR_PARAM_STATUS_PTR = 20;
701 	const SQL_ATTR_PARAMS_PROCESSED_PTR = 21;
702 	const SQL_ATTR_PARAMSET_SIZE = 22;
703 	const SQL_ATTR_QUERY_TIMEOUT = SQL_QUERY_TIMEOUT;
704 	const SQL_ATTR_QUIET_MODE = SQL_QUIET_MODE;
705 	const SQL_ATTR_RETRIEVE_DATA = SQL_RETRIEVE_DATA;
706 	const SQL_ATTR_ROW_ARRAY_SIZE = 27;
707 	const SQL_ATTR_ROW_BIND_OFFSET_PTR = 23;
708 	const SQL_ATTR_ROW_BIND_TYPE = SQL_BIND_TYPE;
709 	const SQL_ATTR_ROW_NUMBER = SQL_ROW_NUMBER;
710 	const SQL_ATTR_ROW_OPERATION_PTR = 24;
711 	const SQL_ATTR_ROW_STATUS_PTR = 25;
712 	const SQL_ATTR_ROWS_FETCHED_PTR = 26;
713 	const SQL_ATTR_SIMULATE_CURSOR = SQL_SIMULATE_CURSOR;
714 	const SQL_ATTR_TRACE = SQL_OPT_TRACE;
715 	const SQL_ATTR_TRACEFILE = SQL_OPT_TRACEFILE;
716 	const SQL_ATTR_TRANSLATE_LIB = SQL_TRANSLATE_DLL;
717 	const SQL_ATTR_TRANSLATE_OPTION = SQL_TRANSLATE_OPTION;
718 	const SQL_ATTR_TXN_ISOLATION = SQL_TXN_ISOLATION;
719 	const SQL_ATTR_USE_BOOKMARKS = SQL_USE_BOOKMARKS;
720 	const SQL_BATCH_ROW_COUNT = 120;
721 	const SQL_BATCH_SUPPORT = 121;
722 	const SQL_BRC_EXPLICIT = 0x0000002;
723 	const SQL_BRC_PROCEDURES = 0x0000001;
724 	const SQL_BRC_ROLLED_UP = 0x0000004;
725 	const SQL_BS_ROW_COUNT_EXPLICIT = 0x00000002L;
726 	const SQL_BS_ROW_COUNT_PROC = 0x00000008L;
727 	const SQL_BS_SELECT_EXPLICIT = 0x00000001L;
728 	const SQL_BS_SELECT_PROC = 0x00000004L;
729 	const SQL_C_INTERVAL_DAY = SQL_INTERVAL_DAY;
730 	const SQL_C_INTERVAL_DAY_TO_HOUR = SQL_INTERVAL_DAY_TO_HOUR;
731 	const SQL_C_INTERVAL_DAY_TO_MINUTE = SQL_INTERVAL_DAY_TO_MINUTE;
732 	const SQL_C_INTERVAL_DAY_TO_SECOND = SQL_INTERVAL_DAY_TO_SECOND;
733 	const SQL_C_INTERVAL_HOUR = SQL_INTERVAL_HOUR;
734 	const SQL_C_INTERVAL_HOUR_TO_MINUTE = SQL_INTERVAL_HOUR_TO_MINUTE;
735 	const SQL_C_INTERVAL_HOUR_TO_SECOND = SQL_INTERVAL_HOUR_TO_SECOND;
736 	const SQL_C_INTERVAL_MINUTE = SQL_INTERVAL_MINUTE;
737 	const SQL_C_INTERVAL_MINUTE_TO_SECOND = SQL_INTERVAL_MINUTE_TO_SECOND;
738 	const SQL_C_INTERVAL_MONTH = SQL_INTERVAL_MONTH;
739 	const SQL_C_INTERVAL_SECOND = SQL_INTERVAL_SECOND;
740 	const SQL_C_INTERVAL_YEAR = SQL_INTERVAL_YEAR;
741 	const SQL_C_INTERVAL_YEAR_TO_MONTH = SQL_INTERVAL_YEAR_TO_MONTH;
742 	const SQL_C_NUMERIC = SQL_NUMERIC;
743 	const SQL_C_SBIGINT = SQL_BIGINT+SQL_SIGNED_OFFSET;
744 	const SQL_C_TYPE_DATE = SQL_TYPE_DATE;
745 	const SQL_C_TYPE_TIME = SQL_TYPE_TIME;
746 	const SQL_C_TYPE_TIMESTAMP = SQL_TYPE_TIMESTAMP;
747 	const SQL_C_UBIGINT = SQL_BIGINT+SQL_UNSIGNED_OFFSET;
748 	const SQL_C_VARBOOKMARK = SQL_C_BINARY;
749 	const SQL_CA_CONSTRAINT_DEFERRABLE = 0x00000040L;
750 	const SQL_CA_CONSTRAINT_INITIALLY_DEFERRED = 0x00000010L;
751 	const SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE = 0x00000020L;
752 	const SQL_CA_CONSTRAINT_NON_DEFERRABLE = 0x00000080L;
753 	const SQL_CA_CREATE_ASSERTION = 0x00000001L;
754 	const SQL_CA1_ABSOLUTE = 0x00000002L;
755 	const SQL_CA1_BOOKMARK = 0x00000008L;
756 	const SQL_CA1_BULK_ADD = 0x00010000L;
757 	const SQL_CA1_BULK_DELETE_BY_BOOKMARK = 0x00040000L;
758 	const SQL_CA1_BULK_FETCH_BY_BOOKMARK = 0x00080000L;
759 	const SQL_CA1_BULK_UPDATE_BY_BOOKMARK = 0x00020000L;
760 	const SQL_CA1_LOCK_EXCLUSIVE = 0x00000080L;
761 	const SQL_CA1_LOCK_NO_CHANGE = 0x00000040L;
762 	const SQL_CA1_LOCK_UNLOCK = 0x00000100L;
763 	const SQL_CA1_NEXT = 0x00000001L;
764 	const SQL_CA1_POS_DELETE = 0x00000800L;
765 	const SQL_CA1_POS_POSITION = 0x00000200L;
766 	const SQL_CA1_POS_REFRESH = 0x00001000L;
767 	const SQL_CA1_POS_UPDATE = 0x00000400L;
768 	const SQL_CA1_POSITIONED_DELETE = 0x00004000L;
769 	const SQL_CA1_POSITIONED_UPDATE = 0x00002000L;
770 	const SQL_CA1_RELATIVE = 0x00000004L;
771 	const SQL_CA1_SELECT_FOR_UPDATE = 0x00008000L;
772 	const SQL_CA2_CRC_APPROXIMATE = 0x00002000L;
773 	const SQL_CA2_CRC_EXACT = 0x00001000L;
774 	const SQL_CA2_LOCK_CONCURRENCY = 0x00000002L;
775 
776 	const SQL_CA2_MAX_ROWS_CATALOG = 0x00000800L;
777 	const SQL_CA2_MAX_ROWS_DELETE  = 0x00000200L;
778 	const SQL_CA2_MAX_ROWS_INSERT  = 0x00000100L;
779 	const SQL_CA2_MAX_ROWS_SELECT  = 0x00000080L;
780 	const SQL_CA2_MAX_ROWS_UPDATE  = 0x00000400L;
781 	const SQL_CA2_MAX_ROWS_AFFECTS_ALL = SQL_CA2_MAX_ROWS_SELECT | SQL_CA2_MAX_ROWS_INSERT |
782 		SQL_CA2_MAX_ROWS_DELETE | SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG;
783 
784 	const SQL_CA2_OPT_ROWVER_CONCURRENCY = 0x00000004L;
785 	const SQL_CA2_OPT_VALUES_CONCURRENCY = 0x00000008L;
786 	const SQL_CA2_READ_ONLY_CONCURRENCY = 0x00000001L;
787 	const SQL_CA2_SENSITIVITY_ADDITIONS = 0x00000010L;
788 	const SQL_CA2_SENSITIVITY_DELETIONS = 0x00000020L;
789 	const SQL_CA2_SENSITIVITY_UPDATES = 0x00000040L;
790 	const SQL_CA2_SIMULATE_NON_UNIQUE = 0x00004000L;
791 	const SQL_CA2_SIMULATE_TRY_UNIQUE = 0x00008000L;
792 	const SQL_CA2_SIMULATE_UNIQUE = 0x00010000L;
793 	const SQL_CATALOG_LOCATION = SQL_QUALIFIER_LOCATION;
794 	const SQL_CATALOG_NAME_SEPARATOR = SQL_QUALIFIER_NAME_SEPARATOR;
795 	const SQL_CATALOG_TERM = SQL_QUALIFIER_TERM;
796 	const SQL_CATALOG_USAGE = SQL_QUALIFIER_USAGE;
797 	const SQL_CCOL_CREATE_COLLATION = 0x00000001L;
798 	const SQL_CCS_COLLATE_CLAUSE = 0x00000002L;
799 	const SQL_CCS_CREATE_CHARACTER_SET = 0x00000001L;
800 	const SQL_CCS_LIMITED_COLLATION = 0x00000004L;
801 	const SQL_CDO_COLLATION = 0x00000008L;
802 	const SQL_CDO_CONSTRAINT = 0x00000004L;
803 	const SQL_CDO_CONSTRAINT_DEFERRABLE = 0x00000080L;
804 	const SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED = 0x00000020L;
805 	const SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE = 0x00000040L;
806 	const SQL_CDO_CONSTRAINT_NAME_DEFINITION = 0x00000010L;
807 	const SQL_CDO_CONSTRAINT_NON_DEFERRABLE = 0x00000100L;
808 	const SQL_CDO_CREATE_DOMAIN = 0x00000001L;
809 	const SQL_CDO_DEFAULT = 0x00000002L;
810 	const SQL_CL_END = SQL_QL_END;
811 	const SQL_CL_START = SQL_QL_START;
812 	const SQL_COL_PRED_BASIC = SQL_ALL_EXCEPT_LIKE;
813 	const SQL_COL_PRED_CHAR = SQL_LIKE_ONLY;
814 	const SQL_COLUMN_DRIVER_START = 1000;
815 	const SQL_COLUMN_IGNORE = SQL_IGNORE;
816 	const SQL_COLUMN_NUMBER_UNKNOWN = -2;
817 	const SQL_CONVERT_GUID = 173;
818 
819 	const SQL_CONVERT_WCHAR               = 122;
820 	const SQL_CONVERT_INTERVAL_DAY_TIME   = 123;
821 	const SQL_CONVERT_INTERVAL_YEAR_MONTH = 124;
822 	const SQL_CONVERT_WLONGVARCHAR        = 125;
823 	const SQL_CONVERT_WVARCHAR            = 126;
824 
825 	const SQL_CREATE_ASSERTION     = 127;
826 	const SQL_CREATE_CHARACTER_SET = 128;
827 	const SQL_CREATE_COLLATION     = 129;
828 	const SQL_CREATE_DOMAIN        = 130;
829 	const SQL_CREATE_SCHEMA        = 131;
830 	const SQL_CREATE_TABLE         = 132;
831 	const SQL_CREATE_TRANSLATION   = 133;
832 	const SQL_CREATE_VIEW          = 134;
833 
834 
835 	const SQL_CP_OFF            = 0UL;
836 	const SQL_CP_DEFAULT        = SQL_CP_OFF;
837 	const SQL_CP_ONE_PER_DRIVER = 1UL;
838 	const SQL_CP_ONE_PER_HENV   = 2UL;
839 
840 	const SQL_CP_STRICT_MATCH  = 0UL;
841 	const SQL_CP_MATCH_DEFAULT = SQL_CP_STRICT_MATCH;
842 	const SQL_CP_RELAXED_MATCH = 1UL;
843 
844 	const SQL_CS_CREATE_SCHEMA         = 0x00000001L;
845 	const SQL_CS_AUTHORIZATION         = 0x00000002L;
846 	const SQL_CS_DEFAULT_CHARACTER_SET = 0x00000004L;
847 
848 	const SQL_CT_COLUMN_COLLATION = 0x00000800L;
849 	const SQL_CT_COLUMN_CONSTRAINT = 0x00000200L;
850 	const SQL_CT_COLUMN_DEFAULT = 0x00000400L;
851 	const SQL_CT_COMMIT_DELETE = 0x00000004L;
852 	const SQL_CT_COMMIT_PRESERVE = 0x00000002L;
853 	const SQL_CT_CONSTRAINT_DEFERRABLE = 0x00000080L;
854 	const SQL_CT_CONSTRAINT_INITIALLY_DEFERRED = 0x00000020L;
855 	const SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE = 0x00000040L;
856 	const SQL_CT_CONSTRAINT_NAME_DEFINITION = 0x00002000L;
857 	const SQL_CT_CONSTRAINT_NON_DEFERRABLE = 0x00000100L;
858 	const SQL_CT_CREATE_TABLE = 0x00000001L;
859 	const SQL_CT_GLOBAL_TEMPORARY = 0x00000008L;
860 	const SQL_CT_LOCAL_TEMPORARY = 0x00000010L;
861 	const SQL_CT_TABLE_CONSTRAINT = 0x00001000L;
862 
863 	const SQL_CTR_CREATE_TRANSLATION = 0x00000001L;
864 
865 	const SQL_CU_DML_STATEMENTS = SQL_QU_DML_STATEMENTS;
866 	const SQL_CU_INDEX_DEFINITION = SQL_QU_INDEX_DEFINITION;
867 	const SQL_CU_PRIVILEGE_DEFINITION = SQL_QU_PRIVILEGE_DEFINITION;
868 	const SQL_CU_PROCEDURE_INVOCATION = SQL_QU_PROCEDURE_INVOCATION;
869 	const SQL_CU_TABLE_DEFINITION = SQL_QU_TABLE_DEFINITION;
870 
871 	const SQL_CVT_INTERVAL_YEAR_MONTH = 0x00080000L;
872 	const SQL_CVT_INTERVAL_DAY_TIME   = 0x00100000L;
873 	const SQL_CVT_WCHAR               = 0x00200000L;
874 	const SQL_CVT_WLONGVARCHAR        = 0x00400000L;
875 	const SQL_CVT_WVARCHAR            = 0x00800000L;
876 	const SQL_CVT_GUID                = 0x01000000L;
877 
878 	const SQL_DA_DROP_ASSERTION = 0x00000001L;
879 	const SQL_DATETIME_LITERALS = 119;
880 
881 	const SQL_DB_DISCONNECT     = 1UL;
882 	const SQL_DB_RETURN_TO_POOL = 0UL;
883 	const SQL_DB_DEFAULT        = SQL_DB_RETURN_TO_POOL;
884 
885 	const SQL_DC_DROP_COLLATION = 0x00000001L;
886 	const SQL_DCS_DROP_CHARACTER_SET = 0x00000001L;
887 	const SQL_DD_CASCADE = 0x00000004L;
888 	const SQL_DD_DROP_DOMAIN = 0x00000001L;
889 	const SQL_DD_RESTRICT = 0x00000002L;
890 	const SQL_DDL_INDEX = 170;
891 	const SQL_DELETE_BY_BOOKMARK = 6;
892 	const SQL_DESC_ARRAY_SIZE = 20;
893 	const SQL_DESC_ARRAY_STATUS_PTR = 21;
894 	const SQL_DESC_AUTO_UNIQUE_VALUE = SQL_COLUMN_AUTO_INCREMENT;
895 	const SQL_DESC_BASE_COLUMN_NAME = 22;
896 	const SQL_DESC_BASE_TABLE_NAME = 23;
897 	const SQL_DESC_BIND_OFFSET_PTR = 24;
898 	const SQL_DESC_BIND_TYPE = 25;
899 	const SQL_DESC_CASE_SENSITIVE = SQL_COLUMN_CASE_SENSITIVE;
900 	const SQL_DESC_CATALOG_NAME = SQL_COLUMN_QUALIFIER_NAME;
901 	const SQL_DESC_CONCISE_TYPE = SQL_COLUMN_TYPE;
902 	const SQL_DESC_DATETIME_INTERVAL_PRECISION = 26;
903 	const SQL_DESC_DISPLAY_SIZE = SQL_COLUMN_DISPLAY_SIZE;
904 	const SQL_DESC_FIXED_PREC_SCALE = SQL_COLUMN_MONEY;
905 	const SQL_DESC_LABEL = SQL_COLUMN_LABEL;
906 	const SQL_DESC_LITERAL_PREFIX = 27;
907 	const SQL_DESC_LITERAL_SUFFIX = 28;
908 	const SQL_DESC_LOCAL_TYPE_NAME = 29;
909 	const SQL_DESC_MAXIMUM_SCALE = 30;
910 	const SQL_DESC_MINIMUM_SCALE = 31;
911 	const SQL_DESC_NUM_PREC_RADIX = 32;
912 	const SQL_DESC_PARAMETER_TYPE = 33;
913 	const SQL_DESC_ROWS_PROCESSED_PTR = 34;
914 	const SQL_DESC_SCHEMA_NAME = SQL_COLUMN_OWNER_NAME;
915 	const SQL_DESC_SEARCHABLE = SQL_COLUMN_SEARCHABLE;
916 	const SQL_DESC_TABLE_NAME = SQL_COLUMN_TABLE_NAME;
917 	const SQL_DESC_TYPE_NAME = SQL_COLUMN_TYPE_NAME;
918 	const SQL_DESC_UNSIGNED = SQL_COLUMN_UNSIGNED;
919 	const SQL_DESC_UPDATABLE = SQL_COLUMN_UPDATABLE;
920 	const SQL_DI_CREATE_INDEX = 0x00000001L;
921 	const SQL_DI_DROP_INDEX = 0x00000002L;
922 
923 	const SQL_DIAG_COLUMN_NUMBER = -1247;
924 	const SQL_DIAG_ROW_NUMBER = -1248;
925 	const SQL_DIAG_CURSOR_ROW_COUNT = -1249;
926 
927 	const SQL_DL_SQL92_DATE = 0x00000001L;
928 	const SQL_DL_SQL92_INTERVAL_DAY = 0x00000020L;
929 	const SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR = 0x00000400L;
930 	const SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE = 0x00000800L;
931 	const SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND = 0x00001000L;
932 	const SQL_DL_SQL92_INTERVAL_HOUR = 0x00000040L;
933 	const SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE = 0x00002000L;
934 	const SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND = 0x00004000L;
935 	const SQL_DL_SQL92_INTERVAL_MINUTE = 0x00000080L;
936 	const SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND = 0x00008000L;
937 	const SQL_DL_SQL92_INTERVAL_MONTH = 0x00000010L;
938 	const SQL_DL_SQL92_INTERVAL_SECOND = 0x00000100L;
939 	const SQL_DL_SQL92_INTERVAL_YEAR = 0x00000008L;
940 	const SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH = 0x00000200L;
941 	const SQL_DL_SQL92_TIME = 0x00000002L;
942 	const SQL_DL_SQL92_TIMESTAMP = 0x00000004L;
943 	const SQL_DM_VER = 171;
944 	const SQL_DRIVER_HDESC = 135;
945 	const SQL_DROP_ASSERTION = 136;
946 	const SQL_DROP_CHARACTER_SET = 137;
947 	const SQL_DROP_COLLATION = 138;
948 	const SQL_DROP_DOMAIN = 139;
949 	const SQL_DROP_SCHEMA = 140;
950 	const SQL_DROP_TABLE = 141;
951 	const SQL_DROP_TRANSLATION = 142;
952 	const SQL_DROP_VIEW = 143;
953 	const SQL_DS_CASCADE = 0x00000004L;
954 	const SQL_DS_DROP_SCHEMA = 0x00000001L;
955 	const SQL_DS_RESTRICT = 0x00000002L;
956 	const SQL_DT_CASCADE = 0x00000004L;
957 	const SQL_DT_DROP_TABLE = 0x00000001L;
958 	const SQL_DT_RESTRICT = 0x00000002L;
959 	const SQL_DTC_DONE = 0L;
960 	const SQL_DTR_DROP_TRANSLATION = 0x00000001L;
961 	const SQL_DV_CASCADE = 0x00000004L;
962 	const SQL_DV_DROP_VIEW = 0x00000001L;
963 	const SQL_DV_RESTRICT = 0x00000002L;
964 	const SQL_DYNAMIC_CURSOR_ATTRIBUTES1 = 144;
965 	const SQL_DYNAMIC_CURSOR_ATTRIBUTES2 = 145;
966 	const SQL_EXT_API_LAST = SQL_API_SQLBINDPARAMETER;
967 	const SQL_EXT_API_START = 40;
968 	const SQL_FETCH_BY_BOOKMARK = 7;
969 	const SQL_FETCH_FIRST_SYSTEM = 32;
970 	const SQL_FETCH_FIRST_USER = 31;
971 	const SQL_FN_CVT_CAST = 0x00000002L;
972 	const SQL_FN_STR_BIT_LENGTH = 0x00080000L;
973 	const SQL_FN_STR_CHAR_LENGTH = 0x00100000L;
974 	const SQL_FN_STR_CHARACTER_LENGTH = 0x00200000L;
975 	const SQL_FN_STR_OCTET_LENGTH = 0x00400000L;
976 	const SQL_FN_STR_POSITION = 0x00800000L;
977 	const SQL_FN_TD_CURRENT_DATE = 0x00020000L;
978 	const SQL_FN_TD_CURRENT_TIME = 0x00040000L;
979 	const SQL_FN_TD_CURRENT_TIMESTAMP = 0x00080000L;
980 	const SQL_FN_TD_EXTRACT = 0x00100000L;
981 	const SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 = 146;
982 	const SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 = 147;
983 	/* #define SQL_FUNC_EXISTS(exists, api)
984 	   ((*(((UWORD*) (exists)) + ((api) >> 4)) & (1 << ((api) & 15)) ) ?
985 	   SQL_TRUE : SQL_FALSE )
986 	*/
987 	const SQL_GB_COLLATE = 0x0004;
988 	const SQL_HANDLE_SENV = 5;
989 
990 	const SQL_IK_NONE = 0;
991 	const SQL_IK_ASC = 1;
992 	const SQL_IK_DESC = 2;
993 	const SQL_IK_ALL = SQL_IK_ASC | SQL_IK_DESC;
994 
995 	const SQL_INDEX_KEYWORDS = 148;
996 	const SQL_INFO_DRIVER_START = 1000;
997 	const SQL_INFO_LAST = SQL_QUALIFIER_LOCATION;
998 	const SQL_INFO_SCHEMA_VIEWS = 149;
999 	const SQL_INITIALLY_DEFERRED = 5;
1000 	const SQL_INITIALLY_IMMEDIATE = 6;
1001 	const SQL_INSERT_STATEMENT = 172;
1002 	const SQL_INTERVAL = 10;
1003 	const SQL_IS_INSERT_LITERALS = 0x00000001L;
1004 	const SQL_IS_INSERT_SEARCHED = 0x00000002L;
1005 	const SQL_IS_INTEGER = -6;
1006 	const SQL_IS_POINTER = -4;
1007 	const SQL_IS_SELECT_INTO = 0x00000004L;
1008 	const SQL_IS_SMALLINT = -8;
1009 	const SQL_IS_UINTEGER = -5;
1010 	const SQL_IS_USMALLINT = -7;
1011 	const SQL_ISV_ASSERTIONS = 0x00000001L;
1012 	const SQL_ISV_CHARACTER_SETS = 0x00000002L;
1013 	const SQL_ISV_CHECK_CONSTRAINTS = 0x00000004L;
1014 	const SQL_ISV_COLLATIONS = 0x00000008L;
1015 	const SQL_ISV_COLUMN_DOMAIN_USAGE = 0x00000010L;
1016 	const SQL_ISV_COLUMN_PRIVILEGES = 0x00000020L;
1017 	const SQL_ISV_COLUMNS = 0x00000040L;
1018 	const SQL_ISV_CONSTRAINT_COLUMN_USAGE = 0x00000080L;
1019 	const SQL_ISV_CONSTRAINT_TABLE_USAGE = 0x00000100L;
1020 	const SQL_ISV_DOMAIN_CONSTRAINTS = 0x00000200L;
1021 	const SQL_ISV_DOMAINS = 0x00000400L;
1022 	const SQL_ISV_KEY_COLUMN_USAGE = 0x00000800L;
1023 	const SQL_ISV_REFERENTIAL_CONSTRAINTS = 0x00001000L;
1024 	const SQL_ISV_SCHEMATA = 0x00002000L;
1025 	const SQL_ISV_SQL_LANGUAGES = 0x00004000L;
1026 	const SQL_ISV_TABLE_CONSTRAINTS = 0x00008000L;
1027 	const SQL_ISV_TABLE_PRIVILEGES = 0x00010000L;
1028 	const SQL_ISV_TABLES = 0x00020000L;
1029 	const SQL_ISV_TRANSLATIONS = 0x00040000L;
1030 	const SQL_ISV_USAGE_PRIVILEGES = 0x00080000L;
1031 	const SQL_ISV_VIEW_COLUMN_USAGE = 0x00100000L;
1032 	const SQL_ISV_VIEW_TABLE_USAGE = 0x00200000L;
1033 	const SQL_ISV_VIEWS = 0x00400000L;
1034 	const SQL_KEYSET_CURSOR_ATTRIBUTES1 = 150;
1035 	const SQL_KEYSET_CURSOR_ATTRIBUTES2 = 151;
1036 	const SQL_MAX_ASYNC_CONCURRENT_STATEMENTS = 10022;
1037 	const SQL_NO_COLUMN_NUMBER = -1;
1038 	const SQL_NO_ROW_NUMBER = -1;
1039 	const SQL_NOT_DEFERRABLE = 7;
1040 	const SQL_NUM_EXTENSIONS = SQL_EXT_API_LAST-SQL_EXT_API_START+1;
1041 	const SQL_NUM_FUNCTIONS = 23;
1042 	const SQL_ODBC_INTERFACE_CONFORMANCE = 152;
1043 
1044 	enum : ULONG {
1045 		SQL_OIC_CORE = 1,
1046 		SQL_OIC_LEVEL1,
1047 		SQL_OIC_LEVEL2
1048 	}
1049 	enum : ULONG {
1050 		SQL_OV_ODBC2 = 2,
1051 		SQL_OV_ODBC3 = 3
1052 	}
1053 
1054 	const ULONG
1055 		SQL_PARAM_BIND_BY_COLUMN = 0,
1056 		SQL_PARAM_BIND_TYPE_DEFAULT = SQL_PARAM_BIND_BY_COLUMN;
1057 
1058 	const SQL_PARAM_ARRAY_ROW_COUNTS = 153;
1059 	const SQL_PARAM_ARRAY_SELECTS = 154;
1060 	const SQL_PARAM_DIAG_UNAVAILABLE = 1;
1061 	const SQL_PARAM_ERROR = 5;
1062 	const SQL_PARAM_IGNORE = 1;
1063 	const SQL_PARAM_PROCEED = 0;
1064 	const SQL_PARAM_SUCCESS = 0;
1065 	const SQL_PARAM_SUCCESS_WITH_INFO = 6;
1066 	const SQL_PARAM_UNUSED = 7;
1067 
1068 	const SQL_PARC_BATCH = 1;
1069 	const SQL_PARC_NO_BATCH = 2;
1070 	const SQL_PAS_BATCH = 1;
1071 	const SQL_PAS_NO_BATCH = 2;
1072 	const SQL_PAS_NO_SELECT = 3;
1073 
1074 	const SQL_ROW_IGNORE = 1;
1075 	const SQL_ROW_NUMBER_UNKNOWN = -2;
1076 	const SQL_ROW_PROCEED = 0;
1077 	const SQL_ROW_SUCCESS_WITH_INFO = 6;
1078 
1079 	const SQL_SC_FIPS127_2_TRANSITIONAL = 0x00000002L;
1080 	const SQL_SC_SQL92_ENTRY = 0x00000001L;
1081 	const SQL_SC_SQL92_FULL = 0x00000008L;
1082 	const SQL_SC_SQL92_INTERMEDIATE = 0x00000004L;
1083 
1084 	const SQL_SCC_ISO92_CLI = 0x00000002L;
1085 	const SQL_SCC_XOPEN_CLI_VERSION1 = 0x00000001L;
1086 
1087 	const SQL_SCHEMA_TERM = SQL_OWNER_TERM;
1088 	const SQL_SCHEMA_USAGE = SQL_OWNER_USAGE;
1089 	const SQL_SDF_CURRENT_DATE = 0x00000001L;
1090 	const SQL_SDF_CURRENT_TIME = 0x00000002L;
1091 	const SQL_SDF_CURRENT_TIMESTAMP = 0x00000004L;
1092 	const SQL_SFKD_CASCADE = 0x00000001L;
1093 	const SQL_SFKD_NO_ACTION = 0x00000002L;
1094 	const SQL_SFKD_SET_DEFAULT = 0x00000004L;
1095 	const SQL_SFKD_SET_NULL = 0x00000008L;
1096 	const SQL_SFKU_CASCADE = 0x00000001L;
1097 	const SQL_SFKU_NO_ACTION = 0x00000002L;
1098 	const SQL_SFKU_SET_DEFAULT = 0x00000004L;
1099 	const SQL_SFKU_SET_NULL = 0x00000008L;
1100 	const SQL_SG_DELETE_TABLE = 0x00000020L;
1101 	const SQL_SG_INSERT_COLUMN = 0x00000080L;
1102 	const SQL_SG_INSERT_TABLE = 0x00000040L;
1103 	const SQL_SG_REFERENCES_COLUMN = 0x00000200L;
1104 	const SQL_SG_REFERENCES_TABLE = 0x00000100L;
1105 	const SQL_SG_SELECT_TABLE = 0x00000400L;
1106 	const SQL_SG_UPDATE_COLUMN = 0x00001000L;
1107 	const SQL_SG_UPDATE_TABLE = 0x00000800L;
1108 	const SQL_SG_USAGE_ON_CHARACTER_SET = 0x00000002L;
1109 	const SQL_SG_USAGE_ON_COLLATION = 0x00000004L;
1110 	const SQL_SG_USAGE_ON_DOMAIN = 0x00000001L;
1111 	const SQL_SG_USAGE_ON_TRANSLATION = 0x00000008L;
1112 	const SQL_SG_WITH_GRANT_OPTION = 0x00000010L;
1113 	const SQL_SNVF_BIT_LENGTH = 0x00000001L;
1114 	const SQL_SNVF_CHAR_LENGTH = 0x00000002L;
1115 	const SQL_SNVF_CHARACTER_LENGTH = 0x00000004L;
1116 	const SQL_SNVF_EXTRACT = 0x00000008L;
1117 	const SQL_SNVF_OCTET_LENGTH = 0x00000010L;
1118 	const SQL_SNVF_POSITION = 0x00000020L;
1119 	const SQL_SP_BETWEEN = 0x00000800L;
1120 	const SQL_SP_COMPARISON = 0x00001000L;
1121 	const SQL_SP_EXISTS = 0x00000001L;
1122 	const SQL_SP_IN = 0x00000400L;
1123 	const SQL_SP_ISNOTNULL = 0x00000002L;
1124 	const SQL_SP_ISNULL = 0x00000004L;
1125 	const SQL_SP_LIKE = 0x00000200L;
1126 	const SQL_SP_MATCH_FULL = 0x00000008L;
1127 	const SQL_SP_MATCH_PARTIAL = 0x00000010L;
1128 	const SQL_SP_MATCH_UNIQUE_FULL = 0x00000020L;
1129 	const SQL_SP_MATCH_UNIQUE_PARTIAL = 0x00000040L;
1130 	const SQL_SP_OVERLAPS = 0x00000080L;
1131 	const SQL_SP_QUANTIFIED_COMPARISON = 0x00002000L;
1132 	const SQL_SP_UNIQUE = 0x00000100L;
1133 	const SQL_SQL_CONFORMANCE = 118;
1134 	const SQL_SQL92_DATETIME_FUNCTIONS = 155;
1135 	const SQL_SQL92_FOREIGN_KEY_DELETE_RULE = 156;
1136 	const SQL_SQL92_FOREIGN_KEY_UPDATE_RULE = 157;
1137 	const SQL_SQL92_GRANT = 158;
1138 	const SQL_SQL92_NUMERIC_VALUE_FUNCTIONS = 159;
1139 	const SQL_SQL92_PREDICATES = 160;
1140 	const SQL_SQL92_RELATIONAL_JOIN_OPERATORS = 161;
1141 	const SQL_SQL92_REVOKE = 162;
1142 	const SQL_SQL92_ROW_VALUE_CONSTRUCTOR = 163;
1143 	const SQL_SQL92_STRING_FUNCTIONS = 164;
1144 	const SQL_SQL92_VALUE_EXPRESSIONS = 165;
1145 	const SQL_SR_CASCADE = 0x00000020L;
1146 	const SQL_SR_DELETE_TABLE = 0x00000080L;
1147 	const SQL_SR_GRANT_OPTION_FOR = 0x00000010L;
1148 	const SQL_SR_INSERT_COLUMN = 0x00000200L;
1149 	const SQL_SR_INSERT_TABLE = 0x00000100L;
1150 	const SQL_SR_REFERENCES_COLUMN = 0x00000800L;
1151 	const SQL_SR_REFERENCES_TABLE = 0x00000400L;
1152 	const SQL_SR_RESTRICT = 0x00000040L;
1153 	const SQL_SR_SELECT_TABLE = 0x00001000L;
1154 	const SQL_SR_UPDATE_COLUMN = 0x00004000L;
1155 	const SQL_SR_UPDATE_TABLE = 0x00002000L;
1156 	const SQL_SR_USAGE_ON_CHARACTER_SET = 0x00000002L;
1157 	const SQL_SR_USAGE_ON_COLLATION = 0x00000004L;
1158 	const SQL_SR_USAGE_ON_DOMAIN = 0x00000001L;
1159 	const SQL_SR_USAGE_ON_TRANSLATION = 0x00000008L;
1160 	const SQL_SRJO_CORRESPONDING_CLAUSE = 0x00000001L;
1161 	const SQL_SRJO_CROSS_JOIN = 0x00000002L;
1162 	const SQL_SRJO_EXCEPT_JOIN = 0x00000004L;
1163 	const SQL_SRJO_FULL_OUTER_JOIN = 0x00000008L;
1164 	const SQL_SRJO_INNER_JOIN = 0x00000010L;
1165 	const SQL_SRJO_INTERSECT_JOIN = 0x00000020L;
1166 	const SQL_SRJO_LEFT_OUTER_JOIN = 0x00000040L;
1167 	const SQL_SRJO_NATURAL_JOIN = 0x00000080L;
1168 	const SQL_SRJO_RIGHT_OUTER_JOIN = 0x00000100L;
1169 	const SQL_SRJO_UNION_JOIN = 0x00000200L;
1170 	const SQL_SRVC_DEFAULT = 0x00000004L;
1171 	const SQL_SRVC_NULL = 0x00000002L;
1172 	const SQL_SRVC_ROW_SUBQUERY = 0x00000008L;
1173 	const SQL_SRVC_VALUE_EXPRESSION = 0x00000001L;
1174 	const SQL_SSF_CONVERT = 0x00000001L;
1175 	const SQL_SSF_LOWER = 0x00000002L;
1176 	const SQL_SSF_SUBSTRING = 0x00000008L;
1177 	const SQL_SSF_TRANSLATE = 0x00000010L;
1178 	const SQL_SSF_TRIM_BOTH = 0x00000020L;
1179 	const SQL_SSF_TRIM_LEADING = 0x00000040L;
1180 	const SQL_SSF_TRIM_TRAILING = 0x00000080L;
1181 	const SQL_SSF_UPPER = 0x00000004L;
1182 	const SQL_STANDARD_CLI_CONFORMANCE = 166;
1183 	const SQL_STATIC_CURSOR_ATTRIBUTES1 = 167;
1184 	const SQL_STATIC_CURSOR_ATTRIBUTES2 = 168;
1185 	const SQL_SU_DML_STATEMENTS = SQL_OU_DML_STATEMENTS;
1186 	const SQL_SU_INDEX_DEFINITION = SQL_OU_INDEX_DEFINITION;
1187 	const SQL_SU_PRIVILEGE_DEFINITION = SQL_OU_PRIVILEGE_DEFINITION;
1188 	const SQL_SU_PROCEDURE_INVOCATION = SQL_OU_PROCEDURE_INVOCATION;
1189 	const SQL_SU_TABLE_DEFINITION = SQL_OU_TABLE_DEFINITION;
1190 	const SQL_SVE_CASE = 0x00000001L;
1191 	const SQL_SVE_CAST = 0x00000002L;
1192 	const SQL_SVE_COALESCE = 0x00000004L;
1193 	const SQL_SVE_NULLIF = 0x00000008L;
1194 	const SQL_UB_FIXED = SQL_UB_ON;
1195 	const SQL_UB_VARIABLE = 2UL;
1196 	const SQL_UNION_STATEMENT = SQL_UNION;
1197 	const SQL_UPDATE_BY_BOOKMARK = 5;
1198 	const SQL_US_UNION = SQL_U_UNION;
1199 	const SQL_US_UNION_ALL = SQL_U_UNION_ALL;
1200 }//[Yes] #endif /* ODBCVER >= 0x300 */
1201 static if (ODBCVER >= 0x0350) {
1202 	const SQL_DESC_ROWVER = 35;
1203 	const SQL_GUID = -11;
1204 	const SQL_C_GUID = SQL_GUID;
1205 	//#ifdef ODBC_STD
1206 	//#define SQLAllocHandle SQLAllocHandleStd
1207 	//#define SQLAllocEnv(p) SQLAllocHandleStd(SQL_HANDLE_ENV, SQL_NULL_HANDLE, p)
1208 	//#define SQL_YEAR SQL_CODE_YEAR
1209 	//#define SQL_MONTH SQL_CODE_MONTH
1210 	//#define SQL_DAY SQL_CODE_DAY
1211 	//#define SQL_HOUR SQL_CODE_HOUR
1212 	//#define SQL_MINUTE SQL_CODE_MINUTE
1213 	//#define SQL_SECOND SQL_CODE_SECOND
1214 	//#define SQL_YEAR_TO_MONTH SQL_CODE_YEAR_TO_MONTH
1215 	//#define SQL_DAY_TO_HOUR SQL_CODE_DAY_TO_HOUR
1216 	//#define SQL_DAY_TO_MINUTE SQL_CODE_DAY_TO_MINUTE
1217 	//#define SQL_DAY_TO_SECOND SQL_CODE_DAY_TO_SECOND
1218 	//#define SQL_HOUR_TO_MINUTE SQL_CODE_HOUR_TO_MINUTE
1219 	//#define SQL_HOUR_TO_SECOND SQL_CODE_HOUR_TO_SECOND
1220 	//#define SQL_MINUTE_TO_SECOND SQL_CODE_MINUTE_TO_SECOND
1221 	//#endif /* ODBC_STD */
1222 }//#endif /* ODBCVER >= 0x0350 */
1223 
1224 //static if (ODBCVER >= 0x0351) {
1225 const SQL_ATTR_ANSI_APP=115;
1226 const SQL_AA_TRUE=1L;
1227 const SQL_AA_FALSE=0L;
1228 //}//[Yes] #endif
1229 
1230 const TRACE_VERSION=1000;
1231 const TRACE_ON=1;
1232 
1233 const char [] SQL_ODBC_KEYWORDS =
1234 	"ABSOLUTE, ACTION, ADA, ADD, ALL, ALLOCATE, ALTER, AND, ANY, ARE, AS, "
1235 	~ "ASC, ASSERTION, AT, AUTHORIZATION, AVG, "
1236 	~ "BEGIN, BETWEEN, BIT, BIT_LENGTH, BOTH, BY, CASCADE, CASCADED, CASE, CAST, CATALOG, "
1237 	~ "CHAR, CHAR_LENGTH, CHARACTER, CHARACTER_LENGTH, CHECK, CLOSE, COALESCE, "
1238 	~ "COLLATE, COLLATION, COLUMN, COMMIT, CONNECT, CONNECTION, CONSTRAINT, "
1239 	~ "CONSTRAINTS, CONTINUE, CONVERT, CORRESPONDING, COUNT, CREATE, CROSS, CURRENT, "
1240 	~ "CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER, CURSOR, "
1241 	~ "DATE, DAY, DEALLOCATE, DEC, DECIMAL, DECLARE, DEFAULT, DEFERRABLE, "
1242 	~ "DEFERRED, DELETE, DESC, DESCRIBE, DESCRIPTOR, DIAGNOSTICS, DISCONNECT, "
1243 	~ "DISTINCT, DOMAIN, DOUBLE, DROP, "
1244 	~ "ELSE, END, END-EXEC, ESCAPE, EXCEPT, EXCEPTION, EXEC, EXECUTE, "
1245 	~ "EXISTS, EXTERNAL, EXTRACT, "
1246 	~ "FALSE, FETCH, FIRST, FLOAT, FOR, FOREIGN, FORTRAN, FOUND, FROM, FULL, "
1247 	~ "GET, GLOBAL, GO, GOTO, GRANT, GROUP, HAVING, HOUR, "
1248 	~ "IDENTITY, IMMEDIATE, IN, INCLUDE, INDEX, INDICATOR, INITIALLY, INNER, "
1249 	~ "INPUT, INSENSITIVE, INSERT, INT, INTEGER, INTERSECT, INTERVAL, INTO, IS, ISOLATION, "
1250 	~ "JOIN, KEY, LANGUAGE, LAST, LEADING, LEFT, LEVEL, LIKE, LOCAL, LOWER, "
1251 	~ "MATCH, MAX, MIN, MINUTE, MODULE, MONTH, "
1252 	~ "NAMES, NATIONAL, NATURAL, NCHAR, NEXT, NO, NONE, NOT, NULL, NULLIF, NUMERIC, "
1253 	~ "OCTET_LENGTH, OF, ON, ONLY, OPEN, OPTION, OR, ORDER, OUTER, OUTPUT, OVERLAPS, "
1254 	~ "PAD, PARTIAL, PASCAL, PLI, POSITION, PRECISION, PREPARE, PRESERVE, "
1255 	~ "PRIMARY, PRIOR, PRIVILEGES, PROCEDURE, PUBLIC, "
1256 	~ "READ, REAL, REFERENCES, RELATIVE, RESTRICT, REVOKE, RIGHT, ROLLBACK, ROWS"
1257 	~ "SCHEMA, SCROLL, SECOND, SECTION, SELECT, SESSION, SESSION_USER, SET, SIZE, "
1258 	~ "SMALLINT, SOME, SPACE, SQL, SQLCA, SQLCODE, SQLERROR, SQLSTATE, SQLWARNING, "
1259 	~ "SUBSTRING, SUM, SYSTEM_USER, "
1260 	~ "TABLE, TEMPORARY, THEN, TIME, TIMESTAMP, TIMEZONE_HOUR, TIMEZONE_MINUTE, "
1261 	~ "TO, TRAILING, TRANSACTION, TRANSLATE, TRANSLATION, TRIM, TRUE, "
1262 	~ "UNION, UNIQUE, UNKNOWN, UPDATE, UPPER, USAGE, USER, USING, "
1263 	~ "VALUE, VALUES, VARCHAR, VARYING, VIEW, WHEN, WHENEVER, WHERE, WITH, WORK, WRITE, "
1264 	~ "YEAR, ZONE";
1265 extern (Windows) {
1266 	SQLRETURN SQLDriverConnect(SQLHDBC, SQLHWND, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLSMALLINT*, SQLUSMALLINT);
1267 	SQLRETURN SQLBrowseConnect(SQLHDBC, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLSMALLINT*);
1268 	SQLRETURN SQLColumnPrivileges(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT);
1269 	SQLRETURN SQLColAttributes(SQLHSTMT, SQLUSMALLINT, SQLUSMALLINT, SQLPOINTER, SQLSMALLINT, SQLSMALLINT*, SQLLEN*);
1270 	SQLRETURN SQLDescribeParam(SQLHSTMT, SQLUSMALLINT, SQLSMALLINT*, SQLULEN*, SQLSMALLINT*, SQLSMALLINT*);
1271 	SQLRETURN SQLExtendedFetch(SQLHSTMT, SQLUSMALLINT, SQLINTEGER, SQLUINTEGER*, SQLUSMALLINT*);
1272 	SQLRETURN SQLForeignKeys(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT);
1273 	SQLRETURN SQLMoreResults(SQLHSTMT);
1274 	SQLRETURN SQLNativeSql(SQLHDBC, SQLCHAR*, SQLINTEGER, SQLCHAR*, SQLINTEGER, SQLINTEGER*);
1275 	SQLRETURN SQLNumParams(SQLHSTMT, SQLSMALLINT*);
1276 	SQLRETURN SQLParamOptions(SQLHSTMT, SQLUINTEGER, SQLUINTEGER*);
1277 	SQLRETURN SQLPrimaryKeys(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT);
1278 	SQLRETURN SQLProcedureColumns(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT);
1279 	SQLRETURN SQLProcedures(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT);
1280 	SQLRETURN SQLSetPos(SQLHSTMT, SQLUSMALLINT, SQLUSMALLINT, SQLUSMALLINT);
1281 	SQLRETURN SQLTablePrivileges(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT);
1282 	SQLRETURN SQLDrivers(SQLHENV, SQLUSMALLINT, SQLCHAR*, SQLSMALLINT, SQLSMALLINT*, SQLCHAR*, SQLSMALLINT, SQLSMALLINT*);
1283 	SQLRETURN SQLBindParameter(SQLHSTMT, SQLUSMALLINT, SQLSMALLINT, SQLSMALLINT, SQLSMALLINT, SQLULEN, SQLSMALLINT, SQLPOINTER, SQLLEN, SQLLEN*);
1284 	SQLRETURN SQLSetScrollOptions(SQLHSTMT, SQLUSMALLINT, SQLLEN, SQLUSMALLINT);/* deprecated */
1285 	DWORD ODBCGetTryWaitValue();
1286 	BOOL ODBCSetTryWaitValue(DWORD);
1287 	RETCODE TraceOpenLogFile(LPWSTR, LPWSTR, DWORD);
1288 	RETCODE TraceCloseLogFile();
1289 	VOID TraceReturn(RETCODE, RETCODE);
1290 	DWORD TraceVersion();
1291 	//static if (ODBCVER >= 0x0300) {
1292 	SQLRETURN SQLBulkOperations(SQLHSTMT, SQLSMALLINT);
1293 	SQLRETURN SQLAllocHandleStd( SQLSMALLINT, SQLHANDLE, SQLHANDLE*);
1294 	//}
1295 }