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