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