1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Package: odbc -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: odbc-constants.lisp
6 ;;;; Purpose: Constants for UFFI interface to ODBC
7 ;;;; Authors: Kevin M. Rosenberg and Paul Meurer
9 ;;;; $Id: odbc-package.lisp 7061 2003-09-07 06:34:45Z kevin $
11 ;;;; This file, part of CLSQL, is Copyright (c) 2004 by Kevin M. Rosenberg
12 ;;;; and Copyright (C) Paul Meurer 1999 - 2001. All rights reserved.
14 ;;;; CLSQL users are granted the rights to distribute and use this software
15 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
16 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
17 ;;;; *************************************************************************
21 (defconstant $ODBCVER #x0210)
23 ;; generally useful constants
24 (defconstant $SQL_SPEC_MAJOR 2) ;; Major version of specification
25 (defconstant $SQL_SPEC_MINOR 10) ;; Minor version of specification
26 (defvar $SQL_SPEC_STRING "02.10") ;; String constant for version
27 (defconstant $SQL_SQLSTATE_SIZE 5) ;; size of SQLSTATE
28 (defconstant $SQL_MAX_MESSAGE_LENGTH 512) ;; message buffer size
29 (defconstant $SQL_MAX_DSN_LENGTH 32) ;; maximum data source name size
32 (defconstant $SQL_INVALID_HANDLE -2)
33 (defconstant $SQL_ERROR -1)
34 (defconstant $SQL_SUCCESS 0)
35 (defconstant $SQL_SUCCESS_WITH_INFO 1)
36 (defconstant $SQL_NO_DATA_FOUND 100)
38 ;; Standard SQL datatypes, using ANSI type numbering
39 (defconstant $SQL_CHAR 1)
40 (defconstant $SQL_NUMERIC 2)
41 (defconstant $SQL_DECIMAL 3)
42 (defconstant $SQL_INTEGER 4)
43 (defconstant $SQL_SMALLINT 5)
44 (defconstant $SQL_FLOAT 6)
45 (defconstant $SQL_REAL 7)
46 (defconstant $SQL_DOUBLE 8)
47 (defconstant $SQL_VARCHAR 12)
49 (defconstant $SQL_TYPE_MIN $SQL_CHAR)
50 (defconstant $SQL_TYPE_NULL 0)
51 (defconstant $SQL_TYPE_MAX $SQL_VARCHAR)
53 ;; C datatype to SQL datatype mapping SQL types
55 (defconstant $SQL_C_CHAR $SQL_CHAR) ;; CHAR, VARCHAR, DECIMAL, NUMERIC
56 (defconstant $SQL_C_LONG $SQL_INTEGER) ;; INTEGER
57 (defconstant $SQL_C_SHORT $SQL_SMALLINT) ;; SMALLINT
58 (defconstant $SQL_C_FLOAT $SQL_REAL) ;; REAL
59 (defconstant $SQL_C_DOUBLE $SQL_DOUBLE) ;; FLOAT, DOUBLE
60 (defconstant $SQL_C_DEFAULT 99)
62 ;; NULL status constants. These are used in SQLColumns, SQLColAttributes,
63 ;;SQLDescribeCol, SQLDescribeParam, and SQLSpecialColumns to describe the
64 ;;nullablity of a column in a table.
66 (defconstant $SQL_NO_NULLS 0)
67 (defconstant $SQL_NULLABLE 1)
68 (defconstant $SQL_NULLABLE_UNKNOWN 2)
70 ;; Special length values
71 (defconstant $SQL_NULL_DATA -1)
72 (defconstant $SQL_DATA_AT_EXEC -2)
73 (defconstant $SQL_NTS -3)
75 ;; SQLFreeStmt defines
76 (defconstant $SQL_CLOSE 0)
77 (defconstant $SQL_DROP 1)
78 (defconstant $SQL_UNBIND 2)
79 (defconstant $SQL_RESET_PARAMS 3)
81 ;; SQLTransact defines
82 (defconstant $SQL_COMMIT 0)
83 (defconstant $SQL_ROLLBACK 1)
85 ;; SQLColAttributes defines
86 (defconstant $SQL_COLUMN_COUNT 0)
87 (defconstant $SQL_COLUMN_NAME 1)
88 (defconstant $SQL_COLUMN_TYPE 2)
89 (defconstant $SQL_COLUMN_LENGTH 3)
90 (defconstant $SQL_COLUMN_PRECISION 4)
91 (defconstant $SQL_COLUMN_SCALE 5)
92 (defconstant $SQL_COLUMN_DISPLAY_SIZE 6)
93 (defconstant $SQL_COLUMN_NULLABLE 7)
94 (defconstant $SQL_COLUMN_UNSIGNED 8)
95 (defconstant $SQL_COLUMN_MONEY 9)
96 (defconstant $SQL_COLUMN_UPDATABLE 10)
97 (defconstant $SQL_COLUMN_AUTO_INCREMENT 11)
98 (defconstant $SQL_COLUMN_CASE_SENSITIVE 12)
99 (defconstant $SQL_COLUMN_SEARCHABLE 13)
100 (defconstant $SQL_COLUMN_TYPE_NAME 14)
101 (defconstant $SQL_COLUMN_TABLE_NAME 15)
102 (defconstant $SQL_COLUMN_OWNER_NAME 16)
103 (defconstant $SQL_COLUMN_QUALIFIER_NAME 17)
104 (defconstant $SQL_COLUMN_LABEL 18)
105 (defconstant $SQL_COLATT_OPT_MAX $SQL_COLUMN_LABEL)
107 (defconstant $SQL_COLUMN_DRIVER_START 1000)
109 (defconstant $SQL_COLATT_OPT_MIN $SQL_COLUMN_COUNT)
111 ;; SQLColAttributes subdefines for SQL_COLUMN_UPDATABLE
112 (defconstant $SQL_ATTR_READONLY 0)
113 (defconstant $SQL_ATTR_WRITE 1)
114 (defconstant $SQL_ATTR_READWRITE_UNKNOWN 2)
116 ;; SQLColAttributes subdefines for SQL_COLUMN_SEARCHABLE
117 ;; These are also used by SQLGetInfo
118 (defconstant $SQL_UNSEARCHABLE 0)
119 (defconstant $SQL_LIKE_ONLY 1)
120 (defconstant $SQL_ALL_EXCEPT_LIKE 2)
121 (defconstant $SQL_SEARCHABLE 3)
124 (defconstant $SQL_NULL_HENV 0)
125 (defconstant $SQL_NULL_HDBC 0)
126 (defconstant $SQL_NULL_HSTMT 0)
128 ;; Defines for SQLGetFunctions
131 (defconstant $SQL_API_SQLALLOCCONNECT 1)
132 (defconstant $SQL_API_SQLALLOCENV 2)
133 (defconstant $SQL_API_SQLALLOCSTMT 3)
134 (defconstant $SQL_API_SQLBINDCOL 4)
135 (defconstant $SQL_API_SQLCANCEL 5)
136 (defconstant $SQL_API_SQLCOLATTRIBUTES 6)
137 (defconstant $SQL_API_SQLCONNECT 7)
138 (defconstant $SQL_API_SQLDESCRIBECOL 8)
139 (defconstant $SQL_API_SQLDISCONNECT 9)
140 (defconstant $SQL_API_SQLERROR 10)
141 (defconstant $SQL_API_SQLEXECDIRECT 11)
142 (defconstant $SQL_API_SQLEXECUTE 12)
143 (defconstant $SQL_API_SQLFETCH 13)
144 (defconstant $SQL_API_SQLFREECONNECT 14)
145 (defconstant $SQL_API_SQLFREEENV 15)
146 (defconstant $SQL_API_SQLFREESTMT 16)
147 (defconstant $SQL_API_SQLGETCURSORNAME 17)
148 (defconstant $SQL_API_SQLNUMRESULTCOLS 18)
149 (defconstant $SQL_API_SQLPREPARE 19)
150 (defconstant $SQL_API_SQLROWCOUNT 20)
151 (defconstant $SQL_API_SQLSETCURSORNAME 21)
152 (defconstant $SQL_API_SQLSETPARAM 22)
153 (defconstant $SQL_API_SQLTRANSACT 23)
154 (defconstant $SQL_NUM_FUNCTIONS 23)
155 (defconstant $SQL_EXT_API_START 40)
159 (defconstant $SQL_API_SQLCOLUMNS 40)
160 (defconstant $SQL_API_SQLDRIVERCONNECT 41)
161 (defconstant $SQL_API_SQLGETCONNECTOPTION 42)
162 (defconstant $SQL_API_SQLGETDATA 43)
163 (defconstant $SQL_API_SQLGETFUNCTIONS 44)
164 (defconstant $SQL_API_SQLGETINFO 45)
165 (defconstant $SQL_API_SQLGETSTMTOPTION 46)
166 (defconstant $SQL_API_SQLGETTYPEINFO 47)
167 (defconstant $SQL_API_SQLPARAMDATA 48)
168 (defconstant $SQL_API_SQLPUTDATA 49)
169 (defconstant $SQL_API_SQLSETCONNECTOPTION 50)
170 (defconstant $SQL_API_SQLSETSTMTOPTION 51)
171 (defconstant $SQL_API_SQLSPECIALCOLUMNS 52)
172 (defconstant $SQL_API_SQLSTATISTICS 53)
173 (defconstant $SQL_API_SQLTABLES 54)
177 (defconstant $SQL_API_SQLBROWSECONNECT 55)
178 (defconstant $SQL_API_SQLCOLUMNPRIVILEGES 56)
179 (defconstant $SQL_API_SQLDATASOURCES 57)
180 (defconstant $SQL_API_SQLDESCRIBEPARAM 58)
181 (defconstant $SQL_API_SQLEXTENDEDFETCH 59)
182 (defconstant $SQL_API_SQLFOREIGNKEYS 60)
183 (defconstant $SQL_API_SQLMORERESULTS 61)
184 (defconstant $SQL_API_SQLNATIVESQL 62)
185 (defconstant $SQL_API_SQLNUMPARAMS 63)
186 (defconstant $SQL_API_SQLPARAMOPTIONS 64)
187 (defconstant $SQL_API_SQLPRIMARYKEYS 65)
188 (defconstant $SQL_API_SQLPROCEDURECOLUMNS 66)
189 (defconstant $SQL_API_SQLPROCEDURES 67)
190 (defconstant $SQL_API_SQLSETPOS 68)
191 (defconstant $SQL_API_SQLSETSCROLLOPTIONS 69)
192 (defconstant $SQL_API_SQLTABLEPRIVILEGES 70)
194 ;/* SDK 2.0 Additions */
195 (defconstant $SQL_API_SQLDRIVERS 71)
196 (defconstant $SQL_API_SQLBINDPARAMETER 72)
197 (defconstant $SQL_EXT_API_LAST $SQL_API_SQLBINDPARAMETER)
199 (defconstant $SQL_API_ALL_FUNCTIONS 0)
201 (defconstant $SQL_NUM_EXTENSIONS (- $SQL_EXT_API_LAST $SQL_EXT_API_START -1))
202 (defconstant $SQL_API_LOADBYORDINAL 199)
204 ;;; Defines for SQLGetInfo
205 (defconstant $SQL_INFO_FIRST 0)
206 (defconstant $SQL_ACTIVE_CONNECTIONS 0)
207 (defconstant $SQL_ACTIVE_STATEMENTS 1)
208 (defconstant $SQL_DATA_SOURCE_NAME 2)
209 (defconstant $SQL_DRIVER_HDBC 3)
210 (defconstant $SQL_DRIVER_HENV 4)
211 (defconstant $SQL_DRIVER_HSTMT 5)
212 (defconstant $SQL_DRIVER_NAME 6)
213 (defconstant $SQL_DRIVER_VER 7)
214 (defconstant $SQL_FETCH_DIRECTION 8)
215 (defconstant $SQL_ODBC_API_CONFORMANCE 9)
216 (defconstant $SQL_ODBC_VER 10)
217 (defconstant $SQL_ROW_UPDATES 11)
218 (defconstant $SQL_ODBC_SAG_CLI_CONFORMANCE 12)
219 (defconstant $SQL_SERVER_NAME 13)
220 (defconstant $SQL_SEARCH_PATTERN_ESCAPE 14)
221 (defconstant $SQL_ODBC_SQL_CONFORMANCE 15)
223 (defconstant $SQL_DBMS_NAME 17)
224 (defconstant $SQL_DBMS_VER 18)
226 (defconstant $SQL_ACCESSIBLE_TABLES 19)
227 (defconstant $SQL_ACCESSIBLE_PROCEDURES 20)
228 (defconstant $SQL_PROCEDURES 21)
229 (defconstant $SQL_CONCAT_NULL_BEHAVIOR 22)
230 (defconstant $SQL_CURSOR_COMMIT_BEHAVIOR 23)
231 (defconstant $SQL_CURSOR_ROLLBACK_BEHAVIOR 24)
232 (defconstant $SQL_DATA_SOURCE_READ_ONLY 25)
233 (defconstant $SQL_DEFAULT_TXN_ISOLATION 26)
234 (defconstant $SQL_EXPRESSIONS_IN_ORDERBY 27)
235 (defconstant $SQL_IDENTIFIER_CASE 28)
236 (defconstant $SQL_IDENTIFIER_QUOTE_CHAR 29)
237 (defconstant $SQL_MAX_COLUMN_NAME_LEN 30)
238 (defconstant $SQL_MAX_CURSOR_NAME_LEN 31)
239 (defconstant $SQL_MAX_OWNER_NAME_LEN 32)
240 (defconstant $SQL_MAX_PROCEDURE_NAME_LEN 33)
241 (defconstant $SQL_MAX_QUALIFIER_NAME_LEN 34)
242 (defconstant $SQL_MAX_TABLE_NAME_LEN 35)
243 (defconstant $SQL_MULT_RESULT_SETS 36)
244 (defconstant $SQL_MULTIPLE_ACTIVE_TXN 37)
245 (defconstant $SQL_OUTER_JOINS 38)
246 (defconstant $SQL_OWNER_TERM 39)
247 (defconstant $SQL_PROCEDURE_TERM 40)
248 (defconstant $SQL_QUALIFIER_NAME_SEPARATOR 41)
249 (defconstant $SQL_QUALIFIER_TERM 42)
250 (defconstant $SQL_SCROLL_CONCURRENCY 43)
251 (defconstant $SQL_SCROLL_OPTIONS 44)
252 (defconstant $SQL_TABLE_TERM 45)
253 (defconstant $SQL_TXN_CAPABLE 46)
254 (defconstant $SQL_USER_NAME 47)
256 (defconstant $SQL_CONVERT_FUNCTIONS 48)
257 (defconstant $SQL_NUMERIC_FUNCTIONS 49)
258 (defconstant $SQL_STRING_FUNCTIONS 50)
259 (defconstant $SQL_SYSTEM_FUNCTIONS 51)
260 (defconstant $SQL_TIMEDATE_FUNCTIONS 52)
262 (defconstant $SQL_CONVERT_BIGINT 53)
263 (defconstant $SQL_CONVERT_BINARY 54)
264 (defconstant $SQL_CONVERT_BIT 55)
265 (defconstant $SQL_CONVERT_CHAR 56)
266 (defconstant $SQL_CONVERT_DATE 57)
267 (defconstant $SQL_CONVERT_DECIMAL 58)
268 (defconstant $SQL_CONVERT_DOUBLE 59)
269 (defconstant $SQL_CONVERT_FLOAT 60)
270 (defconstant $SQL_CONVERT_INTEGER 61)
271 (defconstant $SQL_CONVERT_LONGVARCHAR 62)
272 (defconstant $SQL_CONVERT_NUMERIC 63)
273 (defconstant $SQL_CONVERT_REAL 64)
274 (defconstant $SQL_CONVERT_SMALLINT 65)
275 (defconstant $SQL_CONVERT_TIME 66)
276 (defconstant $SQL_CONVERT_TIMESTAMP 67)
277 (defconstant $SQL_CONVERT_TINYINT 68)
278 (defconstant $SQL_CONVERT_VARBINARY 69)
279 (defconstant $SQL_CONVERT_VARCHAR 70)
280 (defconstant $SQL_CONVERT_LONGVARBINARY 71)
282 (defconstant $SQL_TXN_ISOLATION_OPTION 72)
283 (defconstant $SQL_ODBC_SQL_OPT_IEF 73)
285 ;;; ODBC SDK 1.0 Additions
286 (defconstant $SQL_CORRELATION_NAME 74)
287 (defconstant $SQL_NON_NULLABLE_COLUMNS 75)
289 ;;; ODBC SDK 2.0 Additions
290 (defconstant $SQL_DRIVER_HLIB 76)
291 (defconstant $SQL_DRIVER_ODBC_VER 77)
292 (defconstant $SQL_LOCK_TYPES 78)
293 (defconstant $SQL_POS_OPERATIONS 79)
294 (defconstant $SQL_POSITIONED_STATEMENTS 80)
295 (defconstant $SQL_GETDATA_EXTENSIONS 81)
296 (defconstant $SQL_BOOKMARK_PERSISTENCE 82)
297 (defconstant $SQL_STATIC_SENSITIVITY 83)
298 (defconstant $SQL_FILE_USAGE 84)
299 (defconstant $SQL_NULL_COLLATION 85)
300 (defconstant $SQL_ALTER_TABLE 86)
301 (defconstant $SQL_COLUMN_ALIAS 87)
302 (defconstant $SQL_GROUP_BY 88)
303 (defconstant $SQL_KEYWORDS 89)
304 (defconstant $SQL_ORDER_BY_COLUMNS_IN_SELECT 90)
305 (defconstant $SQL_OWNER_USAGE 91)
306 (defconstant $SQL_QUALIFIER_USAGE 92)
307 (defconstant $SQL_QUOTED_IDENTIFIER_CASE 93)
308 (defconstant $SQL_SPECIAL_CHARACTERS 94)
309 (defconstant $SQL_SUBQUERIES 95)
310 (defconstant $SQL_UNION 96)
311 (defconstant $SQL_MAX_COLUMNS_IN_GROUP_BY 97)
312 (defconstant $SQL_MAX_COLUMNS_IN_INDEX 98)
313 (defconstant $SQL_MAX_COLUMNS_IN_ORDER_BY 99)
314 (defconstant $SQL_MAX_COLUMNS_IN_SELECT 100)
315 (defconstant $SQL_MAX_COLUMNS_IN_TABLE 101)
316 (defconstant $SQL_MAX_INDEX_SIZE 102)
317 (defconstant $SQL_MAX_ROW_SIZE_INCLUDES_LONG 103)
318 (defconstant $SQL_MAX_ROW_SIZE 104)
319 (defconstant $SQL_MAX_STATEMENT_LEN 105)
320 (defconstant $SQL_MAX_TABLES_IN_SELECT 106)
321 (defconstant $SQL_MAX_USER_NAME_LEN 107)
322 (defconstant $SQL_MAX_CHAR_LITERAL_LEN 108)
323 (defconstant $SQL_TIMEDATE_ADD_INTERVALS 109)
324 (defconstant $SQL_TIMEDATE_DIFF_INTERVALS 110)
325 (defconstant $SQL_NEED_LONG_DATA_LEN 111)
326 (defconstant $SQL_MAX_BINARY_LITERAL_LEN 112)
327 (defconstant $SQL_LIKE_ESCAPE_CLAUSE 113)
328 (defconstant $SQL_QUALIFIER_LOCATION 114)
329 (defconstant $SQL_ACTIVE_ENVIRONMENTS 116)
333 /*** ODBC SDK 2.01 Additions ***/)
334 (defconstant $SQL_OJ_CAPABILITIES 65003 ;; Temp value until ODBC 3.0
336 (defconstant $SQL_INFO_LAST SQL_QUALIFIER_LOCATION
338 (defconstant $SQL_INFO_DRIVER_START 1000
340 ;; SQL_CONVERT_* return value bitmasks
342 (defconstant $SQL_CVT_CHAR #x00000001L)
343 (defconstant $SQL_CVT_NUMERIC #x00000002L)
344 (defconstant $SQL_CVT_DECIMAL #x00000004L)
345 (defconstant $SQL_CVT_INTEGER #x00000008L)
346 (defconstant $SQL_CVT_SMALLINT #x00000010L)
347 (defconstant $SQL_CVT_FLOAT #x00000020L)
348 (defconstant $SQL_CVT_REAL #x00000040L)
349 (defconstant $SQL_CVT_DOUBLE #x00000080L)
350 (defconstant $SQL_CVT_VARCHAR #x00000100L)
351 (defconstant $SQL_CVT_LONGVARCHAR #x00000200L)
352 (defconstant $SQL_CVT_BINARY #x00000400L)
353 (defconstant $SQL_CVT_VARBINARY #x00000800L)
354 (defconstant $SQL_CVT_BIT #x00001000L)
355 (defconstant $SQL_CVT_TINYINT #x00002000L)
356 (defconstant $SQL_CVT_BIGINT #x00004000L)
357 (defconstant $SQL_CVT_DATE #x00008000L)
358 (defconstant $SQL_CVT_TIME #x00010000L)
359 (defconstant $SQL_CVT_TIMESTAMP #x00020000L)
360 (defconstant $SQL_CVT_LONGVARBINARY #x00040000L)
362 ;; SQL_CONVERT_FUNCTIONS functions)
363 (defconstant $SQL_FN_CVT_CONVERT #x00000001L)
365 ;; SQL_STRING_FUNCTIONS functions
367 (defconstant $SQL_FN_STR_CONCAT #x00000001L)
368 (defconstant $SQL_FN_STR_INSERT #x00000002L)
369 (defconstant $SQL_FN_STR_LEFT #x00000004L)
370 (defconstant $SQL_FN_STR_LTRIM #x00000008L)
371 (defconstant $SQL_FN_STR_LENGTH #x00000010L)
372 (defconstant $SQL_FN_STR_LOCATE #x00000020L)
373 (defconstant $SQL_FN_STR_LCASE #x00000040L)
374 (defconstant $SQL_FN_STR_REPEAT #x00000080L)
375 (defconstant $SQL_FN_STR_REPLACE #x00000100L)
376 (defconstant $SQL_FN_STR_RIGHT #x00000200L)
377 (defconstant $SQL_FN_STR_RTRIM #x00000400L)
378 (defconstant $SQL_FN_STR_SUBSTRING #x00000800L)
379 (defconstant $SQL_FN_STR_UCASE #x00001000L)
380 (defconstant $SQL_FN_STR_ASCII #x00002000L)
381 (defconstant $SQL_FN_STR_CHAR #x00004000L
382 (defconstant $SQL_FN_STR_DIFFERENCE #x00008000L)
383 (defconstant $SQL_FN_STR_LOCATE_2 #x00010000L)
384 (defconstant $SQL_FN_STR_SOUNDEX #x00020000L)
385 (defconstant $SQL_FN_STR_SPACE #x00040000L
387 ;; SQL_NUMERIC_FUNCTIONS functions
389 (defconstant $SQL_FN_NUM_ABS #x00000001L)
390 (defconstant $SQL_FN_NUM_ACOS #x00000002L)
391 (defconstant $SQL_FN_NUM_ASIN #x00000004L)
392 (defconstant $SQL_FN_NUM_ATAN #x00000008L)
393 (defconstant $SQL_FN_NUM_ATAN2 #x00000010L)
394 (defconstant $SQL_FN_NUM_CEILING #x00000020L)
395 (defconstant $SQL_FN_NUM_COS #x00000040L)
396 (defconstant $SQL_FN_NUM_COT #x00000080L)
397 (defconstant $SQL_FN_NUM_EXP #x00000100L)
398 (defconstant $SQL_FN_NUM_FLOOR #x00000200L)
399 (defconstant $SQL_FN_NUM_LOG #x00000400L)
400 (defconstant $SQL_FN_NUM_MOD #x00000800L)
401 (defconstant $SQL_FN_NUM_SIGN #x00001000L)
402 (defconstant $SQL_FN_NUM_SIN #x00002000L)
403 (defconstant $SQL_FN_NUM_SQRT #x00004000L)
404 (defconstant $SQL_FN_NUM_TAN #x00008000L)
405 (defconstant $SQL_FN_NUM_PI #x00010000L)
406 (defconstant $SQL_FN_NUM_RAND #x00020000L
407 (defconstant $SQL_FN_NUM_DEGREES #x00040000L)
408 (defconstant $SQL_FN_NUM_LOG10 #x00080000L)
409 (defconstant $SQL_FN_NUM_POWER #x00100000L)
410 (defconstant $SQL_FN_NUM_RADIANS #x00200000L)
411 (defconstant $SQL_FN_NUM_ROUND #x00400000L)
412 (defconstant $SQL_FN_NUM_TRUNCATE #x00800000L
414 ;; SQL_TIMEDATE_FUNCTIONS functions
416 (defconstant $SQL_FN_TD_NOW #x00000001L)
417 (defconstant $SQL_FN_TD_CURDATE #x00000002L)
418 (defconstant $SQL_FN_TD_DAYOFMONTH #x00000004L)
419 (defconstant $SQL_FN_TD_DAYOFWEEK #x00000008L)
420 (defconstant $SQL_FN_TD_DAYOFYEAR #x00000010L)
421 (defconstant $SQL_FN_TD_MONTH #x00000020L)
422 (defconstant $SQL_FN_TD_QUARTER #x00000040L)
423 (defconstant $SQL_FN_TD_WEEK #x00000080L)
424 (defconstant $SQL_FN_TD_YEAR #x00000100L)
425 (defconstant $SQL_FN_TD_CURTIME #x00000200L)
426 (defconstant $SQL_FN_TD_HOUR #x00000400L)
427 (defconstant $SQL_FN_TD_MINUTE #x00000800L)
428 (defconstant $SQL_FN_TD_SECOND #x00001000L
429 (defconstant $SQL_FN_TD_TIMESTAMPADD #x00002000L)
430 (defconstant $SQL_FN_TD_TIMESTAMPDIFF #x00004000L)
431 (defconstant $SQL_FN_TD_DAYNAME #x00008000L)
432 (defconstant $SQL_FN_TD_MONTHNAME #x00010000L
434 ;; SQL_SYSTEM_FUNCTIONS functions
436 (defconstant $SQL_FN_SYS_USERNAME #x00000001L)
437 (defconstant $SQL_FN_SYS_DBNAME #x00000002L)
438 (defconstant $SQL_FN_SYS_IFNULL #x00000004L
440 ;; SQL_TIMEDATE_ADD_INTERVALS and SQL_TIMEDATE_DIFF_INTERVALS functions
442 (defconstant $SQL_FN_TSI_FRAC_SECOND #x00000001L)
443 (defconstant $SQL_FN_TSI_SECOND #x00000002L)
444 (defconstant $SQL_FN_TSI_MINUTE #x00000004L)
445 (defconstant $SQL_FN_TSI_HOUR #x00000008L)
446 (defconstant $SQL_FN_TSI_DAY #x00000010L)
447 (defconstant $SQL_FN_TSI_WEEK #x00000020L)
448 (defconstant $SQL_FN_TSI_MONTH #x00000040L)
449 (defconstant $SQL_FN_TSI_QUARTER #x00000080L)
450 (defconstant $SQL_FN_TSI_YEAR #x00000100L
452 ;; SQL_ODBC_API_CONFORMANCE values
454 (defconstant $SQL_OAC_NONE #x0000)
455 (defconstant $SQL_OAC_LEVEL1 #x0001)
456 (defconstant $SQL_OAC_LEVEL2 #x0002
458 ;; SQL_ODBC_SAG_CLI_CONFORMANCE values
460 (defconstant $SQL_OSCC_NOT_COMPLIANT #x0000)
461 (defconstant $SQL_OSCC_COMPLIANT #x0001
463 ;; SQL_ODBC_SQL_CONFORMANCE values
465 (defconstant $SQL_OSC_MINIMUM #x0000)
466 (defconstant $SQL_OSC_CORE #x0001)
467 (defconstant $SQL_OSC_EXTENDED #x0002
469 ;; SQL_CONCAT_NULL_BEHAVIOR values
471 (defconstant $SQL_CB_NULL #x0000)
472 (defconstant $SQL_CB_NON_NULL #x0001
474 ;; SQL_CURSOR_COMMIT_BEHAVIOR and SQL_CURSOR_ROLLBACK_BEHAVIOR values
476 (defconstant $SQL_CB_DELETE #x0000)
477 (defconstant $SQL_CB_CLOSE #x0001)
478 (defconstant $SQL_CB_PRESERVE #x0002
480 ;; SQL_IDENTIFIER_CASE values
482 (defconstant $SQL_IC_UPPER #x0001)
483 (defconstant $SQL_IC_LOWER #x0002)
484 (defconstant $SQL_IC_SENSITIVE #x0003)
485 (defconstant $SQL_IC_MIXED #x0004
487 ;; SQL_TXN_CAPABLE values
490 (defconstant $SQL_TC_NONE 0)
491 (defconstant $SQL_TC_DML 1)
492 (defconstant $SQL_TC_ALL 2)
494 (defconstant $SQL_TC_DDL_COMMIT 3)
495 (defconstant $SQL_TC_DDL_IGNORE 4)
497 ;; SQL_SCROLL_OPTIONS masks
500 (defconstant $SQL_SO_FORWARD_ONLY #x00000001)
501 (defconstant $SQL_SO_KEYSET_DRIVEN #x00000002)
502 (defconstant $SQL_SO_DYNAMIC #x00000004)
503 (defconstant $SQL_SO_MIXED #x00000008)
504 (defconstant $SQL_SO_STATIC #x00000010)
506 ;; SQL_SCROLL_CONCURRENCY masks
508 (defconstant $SQL_SCCO_READ_ONLY #x00000001)
509 (defconstant $SQL_SCCO_LOCK #x00000002)
510 (defconstant $SQL_SCCO_OPT_ROWVER #x00000004)
511 (defconstant $SQL_SCCO_OPT_VALUES #x00000008)
513 ;; SQL_FETCH_DIRECTION masks
515 (defconstant $SQL_FD_FETCH_NEXT #x00000001)
516 (defconstant $SQL_FD_FETCH_FIRST #x00000002)
517 (defconstant $SQL_FD_FETCH_LAST #x00000004)
518 (defconstant $SQL_FD_FETCH_PRIOR #x00000008)
519 (defconstant $SQL_FD_FETCH_ABSOLUTE #x00000010)
520 (defconstant $SQL_FD_FETCH_RELATIVE #x00000020)
521 (defconstant $SQL_FD_FETCH_RESUME #x00000040)
522 (defconstant $SQL_FD_FETCH_BOOKMARK #x00000080)
525 ;; SQL_TXN_ISOLATION_OPTION masks
527 (defconstant $SQL_TXN_READ_UNCOMMITTED #x00000001L)
528 (defconstant $SQL_TXN_READ_COMMITTED #x00000002L)
529 (defconstant $SQL_TXN_REPEATABLE_READ #x00000004L)
530 (defconstant $SQL_TXN_SERIALIZABLE #x00000008L)
531 (defconstant $SQL_TXN_VERSIONING #x00000010L
533 ;; SQL_CORRELATION_NAME values
535 (defconstant $SQL_CN_NONE #x0000)
536 (defconstant $SQL_CN_DIFFERENT #x0001)
537 (defconstant $SQL_CN_ANY #x0002
539 ;; SQL_NON_NULLABLE_COLUMNS values
541 (defconstant $SQL_NNC_NULL #x0000)
542 (defconstant $SQL_NNC_NON_NULL #x0001
544 ;; SQL_NULL_COLLATION values
546 (defconstant $SQL_NC_HIGH #x0000)
547 (defconstant $SQL_NC_LOW #x0001)
548 (defconstant $SQL_NC_START #x0002)
549 (defconstant $SQL_NC_END #x0004
551 ;; SQL_FILE_USAGE values
553 (defconstant $SQL_FILE_NOT_SUPPORTED #x0000)
554 (defconstant $SQL_FILE_TABLE #x0001)
555 (defconstant $SQL_FILE_QUALIFIER #x0002
557 ;; SQL_GETDATA_EXTENSIONS values
559 (defconstant $SQL_GD_ANY_COLUMN #x00000001L)
560 (defconstant $SQL_GD_ANY_ORDER #x00000002L)
561 (defconstant $SQL_GD_BLOCK #x00000004L)
562 (defconstant $SQL_GD_BOUND #x00000008L
564 ;; SQL_ALTER_TABLE values
566 (defconstant $SQL_AT_ADD_COLUMN #x00000001L)
567 (defconstant $SQL_AT_DROP_COLUMN #x00000002L
569 ;; SQL_POSITIONED_STATEMENTS masks
571 (defconstant $SQL_PS_POSITIONED_DELETE #x00000001L)
572 (defconstant $SQL_PS_POSITIONED_UPDATE #x00000002L)
573 (defconstant $SQL_PS_SELECT_FOR_UPDATE #x00000004L
575 ;; SQL_GROUP_BY values
577 (defconstant $SQL_GB_NOT_SUPPORTED #x0000)
578 (defconstant $SQL_GB_GROUP_BY_EQUALS_SELECT #x0001)
579 (defconstant $SQL_GB_GROUP_BY_CONTAINS_SELECT #x0002)
580 (defconstant $SQL_GB_NO_RELATION #x0003
582 ;; SQL_OWNER_USAGE masks
584 (defconstant $SQL_OU_DML_STATEMENTS #x00000001L)
585 (defconstant $SQL_OU_PROCEDURE_INVOCATION #x00000002L)
586 (defconstant $SQL_OU_TABLE_DEFINITION #x00000004L)
587 (defconstant $SQL_OU_INDEX_DEFINITION #x00000008L)
588 (defconstant $SQL_OU_PRIVILEGE_DEFINITION #x00000010L
590 ;; SQL_QUALIFIER_USAGE masks
592 (defconstant $SQL_QU_DML_STATEMENTS #x00000001L)
593 (defconstant $SQL_QU_PROCEDURE_INVOCATION #x00000002L)
594 (defconstant $SQL_QU_TABLE_DEFINITION #x00000004L)
595 (defconstant $SQL_QU_INDEX_DEFINITION #x00000008L)
596 (defconstant $SQL_QU_PRIVILEGE_DEFINITION #x00000010L
598 ;; SQL_SUBQUERIES masks
600 (defconstant $SQL_SQ_COMPARISON #x00000001L)
601 (defconstant $SQL_SQ_EXISTS #x00000002L)
602 (defconstant $SQL_SQ_IN #x00000004L)
603 (defconstant $SQL_SQ_QUANTIFIED #x00000008L)
604 (defconstant $SQL_SQ_CORRELATED_SUBQUERIES #x00000010L
608 (defconstant $SQL_U_UNION #x00000001L)
609 (defconstant $SQL_U_UNION_ALL #x00000002L
611 ;; SQL_BOOKMARK_PERSISTENCE values
613 (defconstant $SQL_BP_CLOSE #x00000001L)
614 (defconstant $SQL_BP_DELETE #x00000002L)
615 (defconstant $SQL_BP_DROP #x00000004L)
616 (defconstant $SQL_BP_TRANSACTION #x00000008L)
617 (defconstant $SQL_BP_UPDATE #x00000010L)
618 (defconstant $SQL_BP_OTHER_HSTMT #x00000020L)
619 (defconstant $SQL_BP_SCROLL #x00000040L
621 ;; SQL_STATIC_SENSITIVITY values
623 (defconstant $SQL_SS_ADDITIONS #x00000001L)
624 (defconstant $SQL_SS_DELETIONS #x00000002L)
625 (defconstant $SQL_SS_UPDATES #x00000004L
627 ;; SQL_LOCK_TYPESL masks
629 (defconstant $SQL_LCK_NO_CHANGE #x00000001L)
630 (defconstant $SQL_LCK_EXCLUSIVE #x00000002L)
631 (defconstant $SQL_LCK_UNLOCK #x00000004L
633 ;; SQL_POS_OPERATIONS masks
636 (defconstant $SQL_POS_POSITION 1) ;; #x00000001L
637 (defconstant $SQL_POS_REFRESH 2) ;; #x00000002L
638 (defconstant $SQL_POS_UPDATE 4) ;; #x00000004L
639 (defconstant $SQL_POS_DELETE 8) ;; #x00000008L
640 (defconstant $SQL_POS_ADD 16) ;; #x00000010L
643 ;; SQL_QUALIFIER_LOCATION values
645 (defconstant $SQL_QL_START #x0001L)
646 (defconstant $SQL_QL_END #x0002L
648 ;; SQL_OJ_CAPABILITIES values
650 (defconstant $SQL_OJ_LEFT #x00000001L)
651 (defconstant $SQL_OJ_RIGHT #x00000002L)
652 (defconstant $SQL_OJ_FULL #x00000004L)
653 (defconstant $SQL_OJ_NESTED #x00000008L)
654 (defconstant $SQL_OJ_NOT_ORDERED #x00000010L)
655 (defconstant $SQL_OJ_INNER #x00000020L)
656 (defconstant $SQL_OJ_ALL_COMPARISON_OPS #x00000040L
658 ;; options for SQLGetStmtOption/SQLSetStmtOption)
659 (defconstant $SQL_QUERY_TIMEOUT 0)
660 (defconstant $SQL_MAX_ROWS 1)
661 (defconstant $SQL_NOSCAN 2)
662 (defconstant $SQL_MAX_LENGTH 3)
663 (defconstant $SQL_ASYNC_ENABLE 4)
664 (defconstant $SQL_BIND_TYPE 5
665 (defconstant $SQL_CURSOR_TYPE 6)
666 (defconstant $SQL_CONCURRENCY 7)
667 (defconstant $SQL_KEYSET_SIZE 8)
668 (defconstant $SQL_ROWSET_SIZE 9)
669 (defconstant $SQL_SIMULATE_CURSOR 10)
670 (defconstant $SQL_RETRIEVE_DATA 11)
671 (defconstant $SQL_USE_BOOKMARKS 12)
672 (defconstant $SQL_GET_BOOKMARK 13 /* GetStmtOption Only)
673 (defconstant $SQL_ROW_NUMBER 14 /* GetStmtOption Only)
674 (defconstant $SQL_STMT_OPT_MAX SQL_ROW_NUMBER
676 (defconstant $SQL_STMT_OPT_MIN SQL_QUERY_TIMEOUT
679 ;; SQL_QUERY_TIMEOUT options)
680 (defconstant $SQL_QUERY_TIMEOUT_DEFAULT 0UL
682 ;; SQL_MAX_ROWS options)
683 (defconstant $SQL_MAX_ROWS_DEFAULT 0UL
685 ;; SQL_NOSCAN options)
686 (defconstant $SQL_NOSCAN_OFF 0UL /* 1.0 FALSE)
687 (defconstant $SQL_NOSCAN_ON 1UL /* 1.0 TRUE)
688 (defconstant $SQL_NOSCAN_DEFAULT SQL_NOSCAN_OFF
690 ;; SQL_MAX_LENGTH options)
691 (defconstant $SQL_MAX_LENGTH_DEFAULT 0UL
693 ;; SQL_ASYNC_ENABLE options)
694 (defconstant $SQL_ASYNC_ENABLE_OFF 0UL)
695 (defconstant $SQL_ASYNC_ENABLE_ON 1UL)
696 (defconstant $SQL_ASYNC_ENABLE_DEFAULT SQL_ASYNC_ENABLE_OFF
698 ;; SQL_BIND_TYPE options)
699 (defconstant $SQL_BIND_BY_COLUMN 0UL)
700 (defconstant $SQL_BIND_TYPE_DEFAULT SQL_BIND_BY_COLUMN ;; Default value
702 ;; SQL_CONCURRENCY options)
703 (defconstant $SQL_CONCUR_READ_ONLY 1)
704 (defconstant $SQL_CONCUR_LOCK 2)
705 (defconstant $SQL_CONCUR_ROWVER 3)
706 (defconstant $SQL_CONCUR_VALUES 4)
707 (defconstant $SQL_CONCUR_DEFAULT SQL_CONCUR_READ_ONLY ;; Default value
709 ;; SQL_CURSOR_TYPE options)
710 (defconstant $SQL_CURSOR_FORWARD_ONLY 0UL)
711 (defconstant $SQL_CURSOR_KEYSET_DRIVEN 1UL)
712 (defconstant $SQL_CURSOR_DYNAMIC 2UL)
713 (defconstant $SQL_CURSOR_STATIC 3UL)
714 (defconstant $SQL_CURSOR_TYPE_DEFAULT SQL_CURSOR_FORWARD_ONLY ;; Default value
716 ;; SQL_ROWSET_SIZE options)
717 (defconstant $SQL_ROWSET_SIZE_DEFAULT 1UL
719 ;; SQL_KEYSET_SIZE options)
720 (defconstant $SQL_KEYSET_SIZE_DEFAULT 0UL
722 ;; SQL_SIMULATE_CURSOR options)
723 (defconstant $SQL_SC_NON_UNIQUE 0UL)
724 (defconstant $SQL_SC_TRY_UNIQUE 1UL)
725 (defconstant $SQL_SC_UNIQUE 2UL
727 ;; SQL_RETRIEVE_DATA options)
728 (defconstant $SQL_RD_OFF 0UL)
729 (defconstant $SQL_RD_ON 1UL)
730 (defconstant $SQL_RD_DEFAULT SQL_RD_ON
732 ;; SQL_USE_BOOKMARKS options)
733 (defconstant $SQL_UB_OFF 0UL)
734 (defconstant $SQL_UB_ON 1UL)
735 (defconstant $SQL_UB_DEFAULT SQL_UB_OFF
740 ;; options for SQLSetConnectOption/SQLGetConnectOption)
741 (defconstant $SQL_ACCESS_MODE 101)
742 (defconstant $SQL_AUTOCOMMIT 102)
743 (defconstant $SQL_LOGIN_TIMEOUT 103)
744 (defconstant $SQL_OPT_TRACE 104)
745 (defconstant $SQL_OPT_TRACEFILE 105)
746 (defconstant $SQL_TRANSLATE_DLL 106)
747 (defconstant $SQL_TRANSLATE_OPTION 107)
748 (defconstant $SQL_TXN_ISOLATION 108)
749 (defconstant $SQL_CURRENT_QUALIFIER 109)
750 (defconstant $SQL_ODBC_CURSORS 110)
751 (defconstant $SQL_QUIET_MODE 111)
752 (defconstant $SQL_PACKET_SIZE 112)
753 (defconstant $SQL_CONN_OPT_MAX $SQL_PACKET_SIZE)
754 (defconstant $SQL_CONNECT_OPT_DRVR_START 1000)
756 ;;#define SQL_CONN_OPT_MIN SQL_ACCESS_MODE
758 ;; SQL_ACCESS_MODE options
759 (defconstant $SQL_MODE_READ_WRITE 0) ; 0UL
760 (defconstant $SQL_MODE_READ_ONLY 1) ; 1UL
761 (defconstant $SQL_MODE_DEFAULT $SQL_MODE_READ_WRITE)
763 ;; SQL_AUTOCOMMIT options)
764 (defconstant $SQL_AUTOCOMMIT_OFF 0) ;0UL
765 (defconstant $SQL_AUTOCOMMIT_ON 1) ;1UL
766 (defconstant $SQL_AUTOCOMMIT_DEFAULT $SQL_AUTOCOMMIT_ON)
768 ;; SQL_LOGIN_TIMEOUT options)
769 (defconstant $SQL_LOGIN_TIMEOUT_DEFAULT 15) ; 15UL
771 ;; SQL_OPT_TRACE options)
772 (defconstant $SQL_OPT_TRACE_OFF 0) ; 0UL
773 (defconstant $SQL_OPT_TRACE_ON 1) ; 1UL
774 (defconstant $SQL_OPT_TRACE_DEFAULT $SQL_OPT_TRACE_OFF)
775 ; #ifndef SQL_OPT_TRACE_FILE_DEFAULT
776 ; (defconstant $SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG"
779 (defconstant $SQL_CUR_USE_IF_NEEDED 0) ; 0UL
780 (defconstant $SQL_CUR_USE_ODBC 1) ; 1UL
781 (defconstant $SQL_CUR_USE_DRIVER 2) ; 2UL
782 (defconstant $SQL_CUR_DEFAULT $SQL_CUR_USE_DRIVER)
785 ;; Column types and scopes in SQLSpecialColumns. )
786 (defconstant $SQL_BEST_ROWID 1)
787 (defconstant $SQL_ROWVER 2)
789 (defconstant $SQL_SCOPE_CURROW 0)
790 (defconstant $SQL_SCOPE_TRANSACTION 1)
791 (defconstant $SQL_SCOPE_SESSION 2
793 ;; Defines for SQLSetPos)
794 (defconstant $SQL_ENTIRE_ROWSET 0
797 ;; Operations in SQLSetPos
799 (defconstant $SQL_POSITION 0) ;; 1.0 FALSE
800 (defconstant $SQL_REFRESH 1) ;; 1.0 TRUE
801 ; #if (ODBCVER >= #x0200))
802 (defconstant $SQL_UPDATE 2)
803 (defconstant $SQL_DELETE 3)
804 (defconstant $SQL_ADD 4)
806 ;; Lock options in SQLSetPos)
807 (defconstant $SQL_LOCK_NO_CHANGE 0) ;; 1.0 FALSE
808 (defconstant $SQL_LOCK_EXCLUSIVE 1) ;; 1.0 TRUE
809 (defconstant $SQL_LOCK_UNLOCK 2)
811 ;; SQLBindParameter extensions
812 (defconstant $SQL_DEFAULT_PARAM -5)
813 (defconstant $SQL_IGNORE -6)
814 (defconstant $SQL_LEN_DATA_AT_EXEC_OFFSET -100)
815 ;(defconstant $SQL_LEN_DATA_AT_EXEC(length) (-length+SQL_LEN_DATA_AT_EXEC_OFFSET)
817 ;; Special return values for SQLGetData
818 (defconstant $SQL_NO_TOTAL -4)
821 ;; Macros for SQLSetPos)
822 (defconstant $SQL_POSITION_TO(hstmt,irow) SQLSetPos(hstmt,irow,SQL_POSITION,SQL_LOCK_NO_CHANGE))
823 (defconstant $SQL_LOCK_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_POSITION,fLock))
824 (defconstant $SQL_REFRESH_RECORD(hstmt,irow,fLock) SQLSetPos(hstmt,irow,SQL_REFRESH,fLock))
825 (defconstant $SQL_UPDATE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_UPDATE,SQL_LOCK_NO_CHANGE))
826 (defconstant $SQL_DELETE_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_DELETE,SQL_LOCK_NO_CHANGE))
827 (defconstant $SQL_ADD_RECORD(hstmt,irow) SQLSetPos(hstmt,irow,SQL_ADD,SQL_LOCK_NO_CHANGE)
831 /* This define is too large for RC)
832 (defconstant $SQL_ODBC_KEYWORDS \
833 "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\
834 "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\
835 "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\
836 "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\
837 "COBOL,COLLATE,COLLATION,COLUMN,COMMIT,CONNECT,CONNECTION,CONSTRAINT,"\
838 "CONSTRAINTS,CONTINUE,CONVERT,CORRESPONDING,COUNT,CREATE,CROSS,CURRENT,"\
839 "CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,"\
840 "DATE,DAY,DEALLOCATE,DEC,DECIMAL,DECLARE,DEFAULT,DEFERRABLE,"\
841 "DEFERRED,DELETE,DESC,DESCRIBE,DESCRIPTOR,DIAGNOSTICS,DISCONNECT,"\
842 "DISTINCT,DOMAIN,DOUBLE,DROP,"\
843 "ELSE,END,END-EXEC,ESCAPE,EXCEPT,EXCEPTION,EXEC,EXECUTE,"\
844 "EXISTS,EXTERNAL,EXTRACT,"\
845 "FALSE,FETCH,FIRST,FLOAT,FOR,FOREIGN,FORTRAN,FOUND,FROM,FULL,"\
846 "GET,GLOBAL,GO,GOTO,GRANT,GROUP,HAVING,HOUR,"\
847 "IDENTITY,IMMEDIATE,IN,INCLUDE,INDEX,INDICATOR,INITIALLY,INNER,"\
848 "INPUT,INSENSITIVE,INSERT,INTEGER,INTERSECT,INTERVAL,INTO,IS,ISOLATION,"\
849 "JOIN,KEY,LANGUAGE,LAST,LEADING,LEFT,LEVEL,LIKE,LOCAL,LOWER,"\
850 "MATCH,MAX,MIN,MINUTE,MODULE,MONTH,MUMPS,"\
851 "NAMES,NATIONAL,NATURAL,NCHAR,NEXT,NO,NONE,NOT,NULL,NULLIF,NUMERIC,"\
852 "OCTET_LENGTH,OF,ON,ONLY,OPEN,OPTION,OR,ORDER,OUTER,OUTPUT,OVERLAPS,"\
853 "PAD,PARTIAL,PASCAL,PLI,POSITION,PRECISION,PREPARE,PRESERVE,"\
854 "PRIMARY,PRIOR,PRIVILEGES,PROCEDURE,PUBLIC,"\
855 "REFERENCES,RELATIVE,RESTRICT,REVOKE,RIGHT,ROLLBACK,ROWS,"\
856 "SCHEMA,SCROLL,SECOND,SECTION,SELECT,SEQUENCE,SESSION,SESSION_USER,SET,SIZE,"\
857 "SMALLINT,SOME,SPACE,SQL,SQLCA,SQLCODE,SQLERROR,SQLSTATE,SQLWARNING,"\
858 "SUBSTRING,SUM,SYSTEM_USER,"\
859 "TABLE,TEMPORARY,THEN,TIME,TIMESTAMP,TIMEZONE_HOUR,TIMEZONE_MINUTE,"\
860 "TO,TRAILING,TRANSACTION,TRANSLATE,TRANSLATION,TRIM,TRUE,"\
861 "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\
862 "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,YEAR")
865 (defconstant $SQL_PARAM_TYPE_UNKNOWN 0)
866 (defconstant $SQL_PARAM_INPUT 1)
867 (defconstant $SQL_PARAM_INPUT_OUTPUT 2)
868 (defconstant $SQL_RESULT_COL 3)
869 (defconstant $SQL_PARAM_OUTPUT 4)
870 (defconstant $SQL_RETURN_VALUE 5)
873 ;; Defines used by both Level 1 and Level 2 functions
875 ;; generally useful constants
876 (defconstant $SQL_MAX_OPTION_STRING_LENGTH 256)
878 ;; Additional return codes)
879 (defconstant $SQL_STILL_EXECUTING 2)
880 (defconstant $SQL_NEED_DATA 99)
882 ;; SQL extended datatypes)
883 (defconstant $SQL_DATE 9)
884 (defconstant $SQL_TIME 10)
885 (defconstant $SQL_TIMESTAMP 11)
886 (defconstant $SQL_LONGVARCHAR -1)
887 (defconstant $SQL_BINARY -2)
888 (defconstant $SQL_VARBINARY -3)
889 (defconstant $SQL_LONGVARBINARY -4)
890 (defconstant $SQL_BIGINT -5)
891 (defconstant $SQL_TINYINT -6)
892 (defconstant $SQL_BIT -7)
894 (defconstant $SQL_INTERVAL_YEAR -80)
895 (defconstant $SQL_INTERVAL_MONTH -81)
896 (defconstant $SQL_INTERVAL_YEAR_TO_MONTH -82)
897 (defconstant $SQL_INTERVAL_DAY -83)
898 (defconstant $SQL_INTERVAL_HOUR -84)
899 (defconstant $SQL_INTERVAL_MINUTE -85)
900 (defconstant $SQL_INTERVAL_SECOND -86)
901 (defconstant $SQL_INTERVAL_DAY_TO_HOUR -87)
902 (defconstant $SQL_INTERVAL_DAY_TO_MINUTE -88)
903 (defconstant $SQL_INTERVAL_DAY_TO_SECOND -89)
904 (defconstant $SQL_INTERVAL_HOUR_TO_MINUTE -90)
905 (defconstant $SQL_INTERVAL_HOUR_TO_SECOND -91)
906 (defconstant $SQL_INTERVAL_MINUTE_TO_SECOND -92)
907 (defconstant $SQL_UNICODE -95)
908 (defconstant $SQL_TYPE_DRIVER_START $SQL_INTERVAL_YEAR)
909 (defconstant $SQL_TYPE_DRIVER_END $SQL_UNICODE)
912 (defconstant $SQL_SIGNED_OFFSET -20)
913 (defconstant $SQL_UNSIGNED_OFFSET -22)
915 ;; C datatype to SQL datatype mapping
916 (defconstant $SQL_C_DATE $SQL_DATE)
917 (defconstant $SQL_C_TIME $SQL_TIME)
918 (defconstant $SQL_C_TIMESTAMP $SQL_TIMESTAMP)
919 (defconstant $SQL_C_BINARY $SQL_BINARY)
920 (defconstant $SQL_C_BIT $SQL_BIT)
921 (defconstant $SQL_C_TINYINT $SQL_TINYINT)
922 (defconstant $SQL_C_SLONG (+ $SQL_C_LONG $SQL_SIGNED_OFFSET)) ;; SIGNED INTEGER
923 (defconstant $SQL_C_SSHORT (+ $SQL_C_SHORT $SQL_SIGNED_OFFSET)) ;; SIGNED SMALLINT
924 (defconstant $SQL_C_STINYINT (+ $SQL_TINYINT $SQL_SIGNED_OFFSET)) ;; SIGNED TINYINT
925 (defconstant $SQL_C_ULONG (+ $SQL_C_LONG $SQL_UNSIGNED_OFFSET)) ;; UNSIGNED INTEGER
926 (defconstant $SQL_C_USHORT (+ $SQL_C_SHORT $SQL_UNSIGNED_OFFSET)) ;; UNSIGNED SMALLINT
927 (defconstant $SQL_C_UTINYINT (+ $SQL_TINYINT $SQL_UNSIGNED_OFFSET)) ;;UNSIGNED TINYINT
928 (defconstant $SQL_C_BOOKMARK $SQL_C_ULONG) ;; BOOKMARK
930 ;; Options for SQLDriverConnect
931 (defconstant $SQL_DRIVER_NOPROMPT 0)
932 (defconstant $SQL_DRIVER_COMPLETE 1)
933 (defconstant $SQL_DRIVER_PROMPT 2)
934 (defconstant $SQL_DRIVER_COMPLETE_REQUIRED 3)
938 ;; SQLExtendedFetch "fFetchType" values
939 (defconstant $SQL_FETCH_NEXT 1)
940 (defconstant $SQL_FETCH_FIRST 2)
941 (defconstant $SQL_FETCH_LAST 3)
942 (defconstant $SQL_FETCH_PRIOR 4)
943 (defconstant $SQL_FETCH_ABSOLUTE 5)
944 (defconstant $SQL_FETCH_RELATIVE 6)
945 (defconstant $SQL_FETCH_BOOKMARK 8)
947 ;;; ODBC v3 constants, added by KMR
949 (defconstant $SQL_ATTR_ODBC_VERSION 200)
950 (defconstant $SQL_OV_ODBC2 2)
951 (defconstant $SQL_OV_ODBC3 3)
952 (defconstant $SQL_INDEX_UNIQUE 0)
953 (defconstant $SQL_INDEX_ALL 1)
954 (defconstant $SQL_QUICK 0)
955 (defconstant $SQL_ENSURE 1)