source: branch/egtra-gdiplus/api_sql.sbp@ 552

Last change on this file since 552 was 1, checked in by (none), 18 years ago
File size: 31.1 KB
Line 
1' api_sql.sbp
2
3#ifndef _INC_SQL
4#define _INC_SQL
5
6
7/* API declaration data types */
8TypeDef SQLCHAR = Byte
9TypeDef SQLSCHAR = Char
10TypeDef SQLDATE = Byte
11TypeDef SQLDECIMAL = Byte
12TypeDef SQLDOUBLE = Double
13TypeDef SQLFLOAT = Double
14TypeDef SQLINTEGER = Long
15TypeDef SQLUINTEGER = DWord
16#ifdef _WIN64
17TypeDef SQLLEN = Int64
18TypeDef SQLULEN = QWord
19TypeDef SQLSETPOSIROW = QWord
20#else
21TypeDef SQLLEN = SQLINTEGER
22TypeDef SQLULEN = SQLUINTEGER
23TypeDef SQLSETPOSIROW = SQLUSMALLINT
24#endif
25
26'For Backward compatibility
27TypeDef SQLROWCOUNT = SQLULEN
28TypeDef SQLROWSETSIZE = SQLULEN
29TypeDef SQLTRANSID = SQLULEN
30TypeDef SQLROWOFFSET = SQLLEN
31
32TypeDef SQLNUMERIC = Byte
33TypeDef SQLPOINTER = VoidPtr
34TypeDef SQLREAL = Single
35TypeDef SQLSMALLINT = Integer
36TypeDef SQLUSMALLINT = Word
37TypeDef SQLTIME = Byte
38TypeDef SQLTIMESTAMP = Byte
39TypeDef SQLVARCHAR = Byte
40
41/* function return type */
42TypeDef SQLRETURN = SQLSMALLINT
43
44/* generic data structures */
45TypeDef SQLHANDLE = VoidPtr
46TypeDef SQLHENV = SQLHANDLE
47TypeDef SQLHDBC = SQLHANDLE
48TypeDef SQLHSTMT = SQLHANDLE
49TypeDef SQLHDESC = SQLHANDLE
50
51
52
53/* transfer types for DATE, TIME, TIMESTAMP */
54Type DATE_STRUCT
55 year As SQLSMALLINT
56 month As SQLUSMALLINT
57 day As SQLUSMALLINT
58End Type
59TypeDef SQL_DATE_STRUCT = DATE_STRUCT
60
61
62Type TIME_STRUCT
63 hour As SQLUSMALLINT
64 minute As SQLUSMALLINT
65 second As SQLUSMALLINT
66End Type
67TypeDef SQL_TIME_STRUCT = TIME_STRUCT
68
69
70Type TIMESTAMP_STRUCT
71 year As SQLSMALLINT
72 month As SQLUSMALLINT
73 day As SQLUSMALLINT
74 hour As SQLUSMALLINT
75 minute As SQLUSMALLINT
76 second As SQLUSMALLINT
77 fraction As SQLUSMALLINT
78End Type
79TypeDef SQL_TIMESTAMP_STRUCT = TIMESTAMP_STRUCT
80
81
82Const Enum SQLINTERVAL
83 SQL_IS_YEAR = 1
84 SQL_IS_MONTH = 2
85 SQL_IS_DAY = 3
86 SQL_IS_HOUR = 4
87 SQL_IS_MINUTE = 5
88 SQL_IS_SECOND = 6
89 SQL_IS_YEAR_TO_MONTH = 7
90 SQL_IS_DAY_TO_HOUR = 8
91 SQL_IS_DAY_TO_MINUTE = 9
92 SQL_IS_DAY_TO_SECOND = 10
93 SQL_IS_HOUR_TO_MINUTE = 11
94 SQL_IS_HOUR_TO_SECOND = 12
95 SQL_IS_MINUTE_TO_SECOND = 13
96End Enum
97
98
99Type SQL_YEAR_MONTH_STRUCT
100 year As SQLUINTEGER
101 month As SQLUINTEGER
102End Type
103
104Type SQL_DAY_SECOND_STRUCT
105 day As SQLUINTEGER
106 hour As SQLUINTEGER
107 minute As SQLUINTEGER
108 second As SQLUINTEGER
109 fraction As SQLUINTEGER
110End Type
111
112Type SQL_INTERVAL_STRUCT
113 interval_type As SQLINTERVAL
114 interval_sign As SQLSMALLINT
115
116 'Union intval
117 year_month As SQL_YEAR_MONTH_STRUCT
118 'day_second As SQL_DAY_SECOND_STRUCT
119 'End Union
120End Type
121
122
123Const SQL_MAX_NUMERIC_LEN = 16
124Type SQL_NUMERIC_STRUCT
125 precision As SQLCHAR
126 scale As SQLSCHAR
127 sign As SQLCHAR
128 val[ELM(SQL_MAX_NUMERIC_LEN)] As SQLCHAR
129End Type
130
131
132TypeDef SQLGUID = GUID
133
134TypeDef BOOKMARK = SQLULEN
135
136typedef SQLWCHAR = Word
137TypeDef SQLTCHAR = SQLCHAR
138
139
140
141
142/* special length/indicator values */
143Const SQL_NULL_DATA = (-1)
144Const SQL_DATA_AT_EXEC = (-2)
145
146
147/* return values from functions */
148Const SQL_SUCCESS = 0
149Const SQL_SUCCESS_WITH_INFO = 1
150Const SQL_NO_DATA = 100
151Const SQL_ERROR = (-1)
152Const SQL_INVALID_HANDLE = (-2)
153
154Const SQL_STILL_EXECUTING = 2
155Const SQL_NEED_DATA = 99
156
157/* test for SQL_SUCCESS or SQL_SUCCESS_WITH_INFO */
158Const SQL_SUCCEEDED(rc) = (((rc) and (not 1))=0)
159
160/* flags for null-terminated string */
161Const SQL_NTS = (-3)
162Const SQL_NTSL = (-3)
163
164/* maximum message length */
165Const SQL_MAX_MESSAGE_LENGTH = 512
166
167/* date/time length constants */
168Const SQL_DATE_LEN = 10
169Const SQL_TIME_LEN = 8 /* add P+1 if precision is nonzero */
170Const SQL_TIMESTAMP_LEN = 19 /* add P+1 if precision is nonzero */
171
172/* handle type identifiers */
173Const SQL_HANDLE_ENV = 1
174Const SQL_HANDLE_DBC = 2
175Const SQL_HANDLE_STMT = 3
176Const SQL_HANDLE_DESC = 4
177
178/* environment attribute */
179Const SQL_ATTR_OUTPUT_NTS = 10001
180
181/* connection attributes */
182Const SQL_ATTR_AUTO_IPD = 10001
183Const SQL_ATTR_METADATA_ID = 10014
184
185/* statement attributes */
186Const SQL_ATTR_APP_ROW_DESC = 10010
187Const SQL_ATTR_APP_PARAM_DESC = 10011
188Const SQL_ATTR_IMP_ROW_DESC = 10012
189Const SQL_ATTR_IMP_PARAM_DESC = 10013
190Const SQL_ATTR_CURSOR_SCROLLABLE = (-1)
191Const SQL_ATTR_CURSOR_SENSITIVITY = (-2)
192
193/* SQL_ATTR_CURSOR_SCROLLABLE values */
194Const SQL_NONSCROLLABLE = 0
195Const SQL_SCROLLABLE = 1
196
197/* identifiers of fields in the SQL descriptor */
198Const SQL_DESC_COUNT = 1001
199Const SQL_DESC_TYPE = 1002
200Const SQL_DESC_LENGTH = 1003
201Const SQL_DESC_OCTET_LENGTH_PTR = 1004
202Const SQL_DESC_PRECISION = 1005
203Const SQL_DESC_SCALE = 1006
204Const SQL_DESC_DATETIME_INTERVAL_CODE = 1007
205Const SQL_DESC_NULLABLE = 1008
206Const SQL_DESC_INDICATOR_PTR = 1009
207Const SQL_DESC_DATA_PTR = 1010
208Const SQL_DESC_NAME = 1011
209Const SQL_DESC_UNNAMED = 1012
210Const SQL_DESC_OCTET_LENGTH = 1013
211Const SQL_DESC_ALLOC_TYPE = 1099
212
213/* identifiers of fields in the diagnostics area */
214Const SQL_DIAG_RETURNCODE = 1
215Const SQL_DIAG_NUMBER = 2
216Const SQL_DIAG_ROW_COUNT = 3
217Const SQL_DIAG_SQLSTATE = 4
218Const SQL_DIAG_NATIVE = 5
219Const SQL_DIAG_MESSAGE_TEXT = 6
220Const SQL_DIAG_DYNAMIC_FUNCTION = 7
221Const SQL_DIAG_CLASS_ORIGIN = 8
222Const SQL_DIAG_SUBCLASS_ORIGIN = 9
223Const SQL_DIAG_CONNECTION_NAME = 10
224Const SQL_DIAG_SERVER_NAME = 11
225Const SQL_DIAG_DYNAMIC_FUNCTION_CODE = 12
226
227/* dynamic function codes */
228Const SQL_DIAG_ALTER_DOMAIN = 3
229Const SQL_DIAG_ALTER_TABLE = 4
230Const SQL_DIAG_CALL = 7
231Const SQL_DIAG_CREATE_ASSERTION = 6
232Const SQL_DIAG_CREATE_CHARACTER_SET = 8
233Const SQL_DIAG_CREATE_COLLATION = 10
234Const SQL_DIAG_CREATE_DOMAIN = 23
235Const SQL_DIAG_CREATE_INDEX = (-1)
236Const SQL_DIAG_CREATE_SCHEMA = 64
237Const SQL_DIAG_CREATE_TABLE = 77
238Const SQL_DIAG_CREATE_TRANSLATION = 79
239Const SQL_DIAG_CREATE_VIEW = 84
240Const SQL_DIAG_DELETE_WHERE = 19
241Const SQL_DIAG_DROP_ASSERTION = 24
242Const SQL_DIAG_DROP_CHARACTER_SET = 25
243Const SQL_DIAG_DROP_COLLATION = 26
244Const SQL_DIAG_DROP_DOMAIN = 27
245Const SQL_DIAG_DROP_INDEX = (-2)
246Const SQL_DIAG_DROP_SCHEMA = 31
247Const SQL_DIAG_DROP_TABLE = 32
248Const SQL_DIAG_DROP_TRANSLATION = 33
249Const SQL_DIAG_DROP_VIEW = 36
250Const SQL_DIAG_DYNAMIC_DELETE_CURSOR = 38
251Const SQL_DIAG_DYNAMIC_UPDATE_CURSOR = 81
252Const SQL_DIAG_GRANT = 48
253Const SQL_DIAG_INSERT = 50
254Const SQL_DIAG_REVOKE = 59
255Const SQL_DIAG_SELECT_CURSOR = 85
256Const SQL_DIAG_UNKNOWN_STATEMENT = 0
257Const SQL_DIAG_UPDATE_WHERE = 82
258
259/* SQL data type codes */
260Const SQL_UNKNOWN_TYPE = 0
261Const SQL_CHAR = 1
262Const SQL_NUMERIC = 2
263Const SQL_DECIMAL = 3
264Const SQL_INTEGER = 4
265Const SQL_SMALLINT = 5
266Const SQL_FLOAT = 6
267Const SQL_REAL = 7
268Const SQL_DOUBLE = 8
269Const SQL_DATETIME = 9
270Const SQL_VARCHAR = 12
271
272/* One-parameter shortcuts for date/time data types */
273Const SQL_TYPE_DATE = 91
274Const SQL_TYPE_TIME = 92
275Const SQL_TYPE_TIMESTAMP = 93
276
277/* Statement attribute values for cursor sensitivity */
278Const SQL_UNSPECIFIED = 0
279Const SQL_INSENSITIVE = 1
280Const SQL_SENSITIVE = 2
281
282/* GetTypeInfo() request for all data types */
283Const SQL_ALL_TYPES = 0
284
285/* Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData() */
286Const SQL_DEFAULT = 99
287
288/* SQLSQLLEN GetData() code indicating that the application row descriptor
289 * specifies the data type
290 */
291Const SQL_ARD_TYPE = (-99)
292
293/* SQL date/time type subcodes */
294Const SQL_CODE_DATE = 1
295Const SQL_CODE_TIME = 2
296Const SQL_CODE_TIMESTAMP = 3
297
298/* CLI option values */
299Const SQL_FALSE = 0
300Const SQL_TRUE = 1
301
302/* values of NULLABLE field in descriptor */
303Const SQL_NO_NULLS = 0
304Const SQL_NULLABLE = 1
305
306/* Value returned by SQLGetTypeInfo() to denote that it is
307 * not known whether or not a data type supports null values.
308 */
309Const SQL_NULLABLE_UNKNOWN = 2
310
311/* Values returned by SQLGetTypeInfo() to show WHERE clause
312 * supported
313 */
314Const SQL_PRED_NONE = 0
315Const SQL_PRED_CHAR = 1
316Const SQL_PRED_BASIC = 2
317
318/* values of UNNAMED field in descriptor */
319Const SQL_NAMED = 0
320Const SQL_UNNAMED = 1
321
322/* values of ALLOC_TYPE field in descriptor */
323Const SQL_DESC_ALLOC_AUTO = 1
324Const SQL_DESC_ALLOC_USER = 2
325
326/* FreeStmt() options */
327Const SQL_CLOSE = 0
328Const SQL_DROP = 1
329Const SQL_UNBIND = 2
330Const SQL_RESET_PARAMS = 3
331
332/* Codes used for FetchOrientation in SQLFetchScroll(),
333 and in SQLDataSources()
334*/
335Const SQL_FETCH_NEXT = 1
336Const SQL_FETCH_FIRST = 2
337
338/* Other codes used for FetchOrientation in SQLFetchScroll() */
339Const SQL_FETCH_LAST = 3
340Const SQL_FETCH_PRIOR = 4
341Const SQL_FETCH_ABSOLUTE = 5
342Const SQL_FETCH_RELATIVE = 6
343
344/* SQLEndTran() options */
345Const SQL_COMMIT = 0
346Const SQL_ROLLBACK = 1
347
348/* null handles returned by SQLAllocHandle() */
349Const SQL_NULL_HENV = 0
350Const SQL_NULL_HDBC = 0
351Const SQL_NULL_HSTMT = 0
352Const SQL_NULL_HDESC = 0
353
354/* null handle used in place of parent handle when allocating HENV */
355Const SQL_NULL_HANDLE = 0
356
357/* Values that may appear in the result set of SQLSpecialColumns() */
358Const SQL_SCOPE_CURROW = 0
359Const SQL_SCOPE_TRANSACTION = 1
360Const SQL_SCOPE_SESSION = 2
361
362Const SQL_PC_UNKNOWN = 0
363Const SQL_PC_NON_PSEUDO = 1
364Const SQL_PC_PSEUDO = 2
365
366/* Reserved value for the IdentifierType argument of SQLSpecialColumns() */
367Const SQL_ROW_IDENTIFIER = 1
368
369/* Reserved values for UNIQUE argument of SQLStatistics() */
370Const SQL_INDEX_UNIQUE = 0
371Const SQL_INDEX_ALL = 1
372
373/* Values that may appear in the result set of SQLStatistics() */
374Const SQL_INDEX_CLUSTERED = 1
375Const SQL_INDEX_HASHED = 2
376Const SQL_INDEX_OTHER = 3
377
378/* SQLGetFunctions() values to identify ODBC APIs */
379Const SQL_API_SQLALLOCCONNECT = 1
380Const SQL_API_SQLALLOCENV = 2
381Const SQL_API_SQLALLOCHANDLE = 1001
382Const SQL_API_SQLALLOCSTMT = 3
383Const SQL_API_SQLBINDCOL = 4
384Const SQL_API_SQLBINDPARAM = 1002
385Const SQL_API_SQLCANCEL = 5
386Const SQL_API_SQLCLOSECURSOR = 1003
387Const SQL_API_SQLCOLATTRIBUTE = 6
388Const SQL_API_SQLCOLUMNS = 40
389Const SQL_API_SQLCONNECT = 7
390Const SQL_API_SQLCOPYDESC = 1004
391Const SQL_API_SQLDATASOURCES = 57
392Const SQL_API_SQLDESCRIBECOL = 8
393Const SQL_API_SQLDISCONNECT = 9
394Const SQL_API_SQLENDTRAN = 1005
395Const SQL_API_SQLERROR = 10
396Const SQL_API_SQLEXECDIRECT = 11
397Const SQL_API_SQLEXECUTE = 12
398Const SQL_API_SQLFETCH = 13
399Const SQL_API_SQLFETCHSCROLL = 1021
400Const SQL_API_SQLFREECONNECT = 14
401Const SQL_API_SQLFREEENV = 15
402Const SQL_API_SQLFREEHANDLE = 1006
403Const SQL_API_SQLFREESTMT = 16
404Const SQL_API_SQLGETCONNECTATTR = 1007
405Const SQL_API_SQLGETCONNECTOPTION = 42
406Const SQL_API_SQLGETCURSORNAME = 17
407Const SQL_API_SQLGETDATA = 43
408Const SQL_API_SQLGETDESCFIELD = 1008
409Const SQL_API_SQLGETDESCREC = 1009
410Const SQL_API_SQLGETDIAGFIELD = 1010
411Const SQL_API_SQLGETDIAGREC = 1011
412Const SQL_API_SQLGETENVATTR = 1012
413Const SQL_API_SQLGETFUNCTIONS = 44
414Const SQL_API_SQLGETINFO = 45
415Const SQL_API_SQLGETSTMTATTR = 1014
416Const SQL_API_SQLGETSTMTOPTION = 46
417Const SQL_API_SQLGETTYPEINFO = 47
418Const SQL_API_SQLNUMRESULTCOLS = 18
419Const SQL_API_SQLPARAMDATA = 48
420Const SQL_API_SQLPREPARE = 19
421Const SQL_API_SQLPUTDATA = 49
422Const SQL_API_SQLROWCOUNT = 20
423Const SQL_API_SQLSETCONNECTATTR = 1016
424Const SQL_API_SQLSETCONNECTOPTION = 50
425Const SQL_API_SQLSETCURSORNAME = 21
426Const SQL_API_SQLSETDESCFIELD = 1017
427Const SQL_API_SQLSETDESCREC = 1018
428Const SQL_API_SQLSETENVATTR = 1019
429Const SQL_API_SQLSETPARAM = 22
430Const SQL_API_SQLSETSTMTATTR = 1020
431Const SQL_API_SQLSETSTMTOPTION = 51
432Const SQL_API_SQLSPECIALCOLUMNS = 52
433Const SQL_API_SQLSTATISTICS = 53
434Const SQL_API_SQLTABLES = 54
435Const SQL_API_SQLTRANSACT = 23
436
437/* Information requested by SQLGetInfo() */
438Const SQL_MAX_DRIVER_CONNECTIONS = 0
439Const SQL_MAXIMUM_DRIVER_CONNECTIONS = SQL_MAX_DRIVER_CONNECTIONS
440Const SQL_MAX_CONCURRENT_ACTIVITIES = 1
441Const SQL_MAXIMUM_CONCURRENT_ACTIVITIES = SQL_MAX_CONCURRENT_ACTIVITIES
442Const SQL_DATA_SOURCE_NAME = 2
443Const SQL_FETCH_DIRECTION = 8
444Const SQL_SERVER_NAME = 13
445Const SQL_SEARCH_PATTERN_ESCAPE = 14
446Const SQL_DBMS_NAME = 17
447Const SQL_DBMS_VER = 18
448Const SQL_ACCESSIBLE_TABLES = 19
449Const SQL_ACCESSIBLE_PROCEDURES = 20
450Const SQL_CURSOR_COMMIT_BEHAVIOR = 23
451Const SQL_DATA_SOURCE_READ_ONLY = 25
452Const SQL_DEFAULT_TXN_ISOLATION = 26
453Const SQL_IDENTIFIER_CASE = 28
454Const SQL_IDENTIFIER_QUOTE_CHAR = 29
455Const SQL_MAX_COLUMN_NAME_LEN = 30
456Const SQL_MAXIMUM_COLUMN_NAME_LENGTH = SQL_MAX_COLUMN_NAME_LEN
457Const SQL_MAX_CURSOR_NAME_LEN = 31
458Const SQL_MAXIMUM_CURSOR_NAME_LENGTH = SQL_MAX_CURSOR_NAME_LEN
459Const SQL_MAX_SCHEMA_NAME_LEN = 32
460Const SQL_MAXIMUM_SCHEMA_NAME_LENGTH = SQL_MAX_SCHEMA_NAME_LEN
461Const SQL_MAX_CATALOG_NAME_LEN = 34
462Const SQL_MAXIMUM_CATALOG_NAME_LENGTH = SQL_MAX_CATALOG_NAME_LEN
463Const SQL_MAX_TABLE_NAME_LEN = 35
464Const SQL_SCROLL_CONCURRENCY = 43
465Const SQL_TXN_CAPABLE = 46
466Const SQL_TRANSACTION_CAPABLE = SQL_TXN_CAPABLE
467Const SQL_USER_NAME = 47
468Const SQL_TXN_ISOLATION_OPTION = 72
469Const SQL_TRANSACTION_ISOLATION_OPTION = SQL_TXN_ISOLATION_OPTION
470Const SQL_INTEGRITY = 73
471Const SQL_GETDATA_EXTENSIONS = 81
472Const SQL_NULL_COLLATION = 85
473Const SQL_ALTER_TABLE = 86
474Const SQL_ORDER_BY_COLUMNS_IN_SELECT = 90
475Const SQL_SPECIAL_CHARACTERS = 94
476Const SQL_MAX_COLUMNS_IN_GROUP_BY = 97
477Const SQL_MAXIMUM_COLUMNS_IN_GROUP_BY = SQL_MAX_COLUMNS_IN_GROUP_BY
478Const SQL_MAX_COLUMNS_IN_INDEX = 98
479Const SQL_MAXIMUM_COLUMNS_IN_INDEX = SQL_MAX_COLUMNS_IN_INDEX
480Const SQL_MAX_COLUMNS_IN_ORDER_BY = 99
481Const SQL_MAXIMUM_COLUMNS_IN_ORDER_BY = SQL_MAX_COLUMNS_IN_ORDER_BY
482Const SQL_MAX_COLUMNS_IN_SELECT = 100
483Const SQL_MAXIMUM_COLUMNS_IN_SELECT = SQL_MAX_COLUMNS_IN_SELECT
484Const SQL_MAX_COLUMNS_IN_TABLE = 101
485Const SQL_MAX_INDEX_SIZE = 102
486Const SQL_MAXIMUM_INDEX_SIZE = SQL_MAX_INDEX_SIZE
487Const SQL_MAX_ROW_SIZE = 104
488Const SQL_MAXIMUM_ROW_SIZE = SQL_MAX_ROW_SIZE
489Const SQL_MAX_STATEMENT_LEN = 105
490Const SQL_MAXIMUM_STATEMENT_LENGTH = SQL_MAX_STATEMENT_LEN
491Const SQL_MAX_TABLES_IN_SELECT = 106
492Const SQL_MAXIMUM_TABLES_IN_SELECT = SQL_MAX_TABLES_IN_SELECT
493Const SQL_MAX_USER_NAME_LEN = 107
494Const SQL_MAXIMUM_USER_NAME_LENGTH = SQL_MAX_USER_NAME_LEN
495Const SQL_OJ_CAPABILITIES = 115
496Const SQL_OUTER_JOIN_CAPABILITIES = SQL_OJ_CAPABILITIES
497
498Const SQL_XOPEN_CLI_YEAR = 10000
499Const SQL_CURSOR_SENSITIVITY = 10001
500Const SQL_DESCRIBE_PARAMETER = 10002
501Const SQL_CATALOG_NAME = 10003
502Const SQL_COLLATION_SEQ = 10004
503Const SQL_MAX_IDENTIFIER_LEN = 10005
504Const SQL_MAXIMUM_IDENTIFIER_LENGTH = SQL_MAX_IDENTIFIER_LEN
505
506/* SQL_ALTER_TABLE bitmasks */
507Const SQL_AT_ADD_COLUMN = &H00000001
508Const SQL_AT_DROP_COLUMN = &H00000002
509Const SQL_AT_ADD_CONSTRAINT = &H00000008
510
511/* SQL_ASYNC_MODE values */
512Const SQL_AM_NONE = 0
513Const SQL_AM_CONNECTION = 1
514Const SQL_AM_STATEMENT = 2
515
516/* SQL_CURSOR_COMMIT_BEHAVIOR values */
517Const SQL_CB_DELETE = 0
518Const SQL_CB_CLOSE = 1
519Const SQL_CB_PRESERVE = 2
520
521/* SQL_FETCH_DIRECTION bitmasks */
522Const SQL_FD_FETCH_NEXT = &H00000001
523Const SQL_FD_FETCH_FIRST = &H00000002
524Const SQL_FD_FETCH_LAST = &H00000004
525Const SQL_FD_FETCH_PRIOR = &H00000008
526Const SQL_FD_FETCH_ABSOLUTE = &H00000010
527Const SQL_FD_FETCH_RELATIVE = &H00000020
528
529/* SQL_GETDATA_EXTENSIONS bitmasks */
530Const SQL_GD_ANY_COLUMN = &H00000001
531Const SQL_GD_ANY_ORDER = &H00000002
532
533/* SQL_IDENTIFIER_CASE values */
534Const SQL_IC_UPPER = 1
535Const SQL_IC_LOWER = 2
536Const SQL_IC_SENSITIVE = 3
537Const SQL_IC_MIXED = 4
538
539/* SQL_OJ_CAPABILITIES bitmasks */
540/* NB: this means 'outer join', not what you may be thinking */
541
542
543Const SQL_OJ_LEFT = &H00000001
544Const SQL_OJ_RIGHT = &H00000002
545Const SQL_OJ_FULL = &H00000004
546Const SQL_OJ_NESTED = &H00000008
547Const SQL_OJ_NOT_ORDERED = &H00000010
548Const SQL_OJ_INNER = &H00000020
549Const SQL_OJ_ALL_COMPARISON_OPS = &H00000040
550
551/* SQL_SCROLL_CONCURRENCY bitmasks */
552Const SQL_SCCO_READ_ONLY = &H00000001
553Const SQL_SCCO_LOCK = &H00000002
554Const SQL_SCCO_OPT_ROWVER = &H00000004
555Const SQL_SCCO_OPT_VALUES = &H00000008
556
557/* SQL_TXN_CAPABLE values */
558Const SQL_TC_NONE = 0
559Const SQL_TC_DML = 1
560Const SQL_TC_ALL = 2
561Const SQL_TC_DDL_COMMIT = 3
562Const SQL_TC_DDL_IGNORE = 4
563
564/* SQL_TXN_ISOLATION_OPTION bitmasks */
565Const SQL_TXN_READ_UNCOMMITTED = &H00000001
566Const SQL_TRANSACTION_READ_UNCOMMITTED = SQL_TXN_READ_UNCOMMITTED
567Const SQL_TXN_READ_COMMITTED = &H00000002
568Const SQL_TRANSACTION_READ_COMMITTED = SQL_TXN_READ_COMMITTED
569Const SQL_TXN_REPEATABLE_READ = &H00000004
570Const SQL_TRANSACTION_REPEATABLE_READ = SQL_TXN_REPEATABLE_READ
571Const SQL_TXN_SERIALIZABLE = &H00000008
572Const SQL_TRANSACTION_SERIALIZABLE = SQL_TXN_SERIALIZABLE
573
574/* SQL_NULL_COLLATION values */
575Const SQL_NC_HIGH = 0
576Const SQL_NC_LOW = 1
577
578
579Declare Function SQLAllocConnect Lib "odbc32.dll" (
580 EnvironmentHandle As SQLHENV,
581 ByRef ConnectionHandle As SQLHDBC) As SQLRETURN
582
583Declare Function SQLAllocEnv Lib "odbc32.dll" (ByRef EnvironmentHandle As SQLHENV) As SQLRETURN
584
585Declare Function SQLAllocHandle Lib "odbc32.dll" (HandleType As SQLSMALLINT,
586 InputHandle As SQLHANDLE, ByRef OutputHandle As SQLHANDLE) As SQLRETURN
587
588Declare Function SQLAllocStmt Lib "odbc32.dll" (ConnectionHandle As SQLHDBC,
589 ByRef StatementHandle As SQLHSTMT) As SQLRETURN
590
591Declare Function SQLBindCol Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
592 ColumnNumber As SQLUSMALLINT, TargetType As SQLSMALLINT,
593 ByRef TargetValue As Any, BufferLength As SQLLEN,
594 ByRef StrLen_or_Ind As SQLLEN) As SQLRETURN
595
596Declare Function SQLBindParam Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
597 ParameterNumber As SQLUSMALLINT, ValueType As SQLSMALLINT,
598 ParameterType As SQLSMALLINT, LengthPrecision As SQLULEN,
599 ParameterScale As SQLSMALLINT, ParameterValue As SQLPOINTER,
600 ByRef StrLen_or_Ind As SQLLEN) As SQLRETURN
601
602Declare Function SQLCancel Lib "odbc32.dll" (StatementHandle As SQLHSTMT) As SQLRETURN
603
604Declare Function SQLCloseCursor Lib "odbc32.dll" (StatementHandle As SQLHSTMT) As SQLRETURN
605
606#ifdef _WIN64
607Declare Function SQLColAttribute Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
608 ColumnNumber As SQLUSMALLINT, FieldIdentifier As SQLUSMALLINT,
609 CharacterAttribute As SQLPOINTER, BufferLength As SQLSMALLINT,
610 ByRef StringLength As SQLSMALLINT, ByRef NumericAttribute As SQLLEN) As SQLRETURN
611#else
612Declare Function SQLColAttribute Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
613 ColumnNumber As SQLUSMALLINT, FieldIdentifier As SQLUSMALLINT,
614 CharacterAttribute As SQLPOINTER, BufferLength As SQLSMALLINT,
615 ByRef StringLength As SQLSMALLINT, NumericAttribute As SQLPOINTER) As SQLRETURN
616#endif
617
618
619Declare Function SQLColumns Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
620 CatalogName As *SQLCHAR, NameLength1 As SQLSMALLINT,
621 SchemaName As *SQLCHAR, NameLength2 As SQLSMALLINT,
622 TableName As *SQLCHAR, NameLength3 As SQLSMALLINT,
623 ColumnName As *SQLCHAR, NameLength4 As SQLSMALLINT) As SQLRETURN
624
625
626Declare Function SQLConnect Lib "odbc32.dll" (ConnectionHandle As SQLHDBC,
627 ServerName As *SQLCHAR, NameLength1 As SQLSMALLINT,
628 UserName As *SQLCHAR, NameLength2 As SQLSMALLINT,
629 Authentication As *SQLCHAR, NameLength3 As SQLSMALLINT) As SQLRETURN
630
631Declare Function SQLCopyDesc Lib "odbc32.dll" (SourceDescHandle As SQLHDESC,
632 TargetDescHandle As SQLHDESC) As SQLRETURN
633
634Declare Function SQLDataSources Lib "odbc32.dll" (EnvironmentHandle As SQLHENV,
635 Direction As SQLUSMALLINT, ServerName As *SQLCHAR,
636 BufferLength1 As SQLSMALLINT, ByRef NameLength1 As SQLSMALLINT,
637 Description As *SQLCHAR, BufferLength2 As SQLSMALLINT,
638 ByRef NameLength2 As SQLSMALLINT) As SQLRETURN
639
640Declare Function SQLDescribeCol Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
641 ColumnNumber As SQLSMALLINT, ColumnName As *SQLCHAR,
642 BufferLength As SQLSMALLINT, ByRef NameLength As SQLSMALLINT,
643 ByRef DataType As SQLSMALLINT, ByRef ColumnSize As SQLINTEGER,
644 ByRef DecimalDigits As SQLSMALLINT, ByRef Nullable As SQLSMALLINT) As SQLRETURN
645
646Declare Function SQLDisconnect Lib "odbc32.dll" (ConnectionHandle As SQLHDBC) As SQLRETURN
647
648Declare Function SQLEndTran Lib "odbc32.dll" (HandleType As SQLSMALLINT, Handle As SQLHANDLE,
649 CompletionType As SQLSMALLINT) As SQLRETURN
650
651Declare Function SQLError Lib "odbc32.dll" (EnvironmentHandle As SQLHENV,
652 ConnectionHandle As SQLHDBC, StatementHandle As SQLHSTMT,
653 Sqlstate As *SQLCHAR, ByRef NativeError As SQLINTEGER,
654 MessageText As *SQLCHAR, BufferLength As SQLSMALLINT,
655 ByRef TextLength As SQLSMALLINT) As SQLRETURN
656
657Declare Function SQLExecDirect Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
658 StatementText As *SQLCHAR, TextLength As SQLINTEGER) As SQLRETURN
659
660Declare Function SQLExecute Lib "odbc32.dll" (StatementHandle As SQLHSTMT) As SQLRETURN
661
662Declare Function SQLFetch Lib "odbc32.dll" (StatementHandle As SQLHSTMT) As SQLRETURN
663
664Declare Function SQLFetchScroll Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
665 FetchOrientation As SQLSMALLINT, FetchOffset As SQLLEN) As SQLRETURN
666
667Declare Function SQLFreeConnect Lib "odbc32.dll" (ConnectionHandle As SQLHDBC) As SQLRETURN
668
669Declare Function SQLFreeEnv Lib "odbc32.dll" (EnvironmentHandle As SQLHENV) As SQLRETURN
670
671Declare Function SQLFreeHandle Lib "odbc32.dll" (HandleType As SQLSMALLINT, Handle As SQLHANDLE) As SQLRETURN
672
673Declare Function SQLFreeStmt Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
674 Option As SQLUSMALLINT) As SQLRETURN
675
676Declare Function SQLGetConnectAttr Lib "odbc32.dll" (ConnectionHandle As SQLHDBC,
677 Attribute As SQLINTEGER, Value As SQLPOINTER,
678 BufferLength As SQLINTEGER, ByRef StringLength As SQLINTEGER) As SQLRETURN
679
680Declare Function SQLGetConnectOption Lib "odbc32.dll" (ConnectionHandle As SQLHDBC,
681 Option As SQLUSMALLINT, Value As SQLPOINTER) As SQLRETURN
682
683Declare Function SQLGetCursorName Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
684 CursorName As *SQLCHAR, BufferLength As SQLSMALLINT,
685 ByRef NameLength As SQLSMALLINT) As SQLRETURN
686
687Declare Function SQLGetData Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
688 ColumnNumber As SQLUSMALLINT, TargetType As SQLSMALLINT,
689 TargetValue As SQLPOINTER, BufferLength As SQLLEN,
690 ByRef StrLen_or_Ind As SQLLEN) As SQLRETURN
691
692Declare Function SQLGetDescField Lib "odbc32.dll" (DescriptorHandle As SQLHDESC,
693 RecNumber As SQLSMALLINT, FieldIdentifier As SQLSMALLINT,
694 Value As SQLPOINTER, BufferLength As SQLINTEGER,
695 ByRef StringLength As SQLINTEGER) As SQLRETURN
696
697Declare Function SQLGetDescRec Lib "odbc32.dll" (DescriptorHandle As SQLHDESC,
698 RecNumber As SQLSMALLINT, Name As *SQLCHAR,
699 BufferLength As SQLSMALLINT, ByRef StringLength As SQLSMALLINT,
700 ByRef iType As SQLSMALLINT, ByRef SubType As SQLSMALLINT,
701 ByRef Length As SQLLEN, ByRef Precision As SQLSMALLINT,
702 ByRef Scale As SQLSMALLINT, ByRef Nullable As SQLSMALLINT) As SQLRETURN
703
704Declare Function SQLGetDiagField Lib "odbc32.dll" (HandleType As SQLSMALLINT, Handle As SQLHANDLE,
705 RecNumber As SQLSMALLINT, DiagIdentifier As SQLSMALLINT,
706 DiagInfo As SQLPOINTER, BufferLength As SQLSMALLINT,
707 ByRef StringLength As SQLSMALLINT) As SQLRETURN
708
709Declare Function SQLGetDiagRec Lib "odbc32.dll" (HandleType As SQLSMALLINT, Handle As SQLHANDLE,
710 RecNumber As SQLSMALLINT, Sqlstate As *SQLCHAR,
711 ByRef NativeError As SQLINTEGER, MessageText As *SQLCHAR,
712 BufferLength As SQLSMALLINT, ByRef TextLength As SQLSMALLINT) As SQLRETURN
713
714Declare Function SQLGetEnvAttr Lib "odbc32.dll" (EnvironmentHandle As SQLHENV,
715 Attribute As SQLINTEGER, Value As SQLPOINTER,
716 BufferLength As SQLINTEGER, ByRef StringLength As SQLINTEGER) As SQLRETURN
717
718Declare Function SQLGetFunctions Lib "odbc32.dll" (ConnectionHandle As SQLHDBC,
719 FunctionId As SQLUSMALLINT, ByRef Supported As SQLUSMALLINT) As SQLRETURN
720
721Declare Function SQLGetInfo Lib "odbc32.dll" (ConnectionHandle As SQLHDBC,
722 InfoType As SQLUSMALLINT, InfoValue As SQLPOINTER,
723 BufferLength As SQLSMALLINT, ByRef StringLength As SQLSMALLINT) As SQLRETURN
724
725Declare Function SQLGetStmtAttr Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
726 Attribute As SQLINTEGER, Value As SQLPOINTER,
727 BufferLength As SQLINTEGER, ByRef StringLength As SQLINTEGER) As SQLRETURN
728
729Declare Function SQLGetStmtOption Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
730 Option As SQLUSMALLINT, Value As SQLPOINTER) As SQLRETURN
731
732Declare Function SQLGetTypeInfo Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
733 DataType As SQLSMALLINT) As SQLRETURN
734
735Declare Function SQLNumResultCols Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
736 ByRef ColumnCount As SQLSMALLINT) As SQLRETURN
737
738Declare Function SQLParamData Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
739 ByRef Value As SQLPOINTER) As SQLRETURN
740
741Declare Function SQLPrepare Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
742 StatementText As *SQLCHAR, TextLength As SQLINTEGER) As SQLRETURN
743
744Declare Function SQLPutData Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
745 Data As SQLPOINTER, StrLen_or_Ind As SQLLEN) As SQLRETURN
746
747Declare Function SQLRowCount Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
748 ByRef RowCount As SQLLEN) As SQLRETURN
749
750Declare Function SQLSetConnectAttr Lib "odbc32.dll" (ConnectionHandle As SQLHDBC,
751 Attribute As SQLINTEGER, Value As SQLPOINTER,
752 StringLength As SQLINTEGER) As SQLRETURN
753
754Declare Function SQLSetConnectOption Lib "odbc32.dll" (ConnectionHandle As SQLHDBC,
755 Option As SQLUSMALLINT, Value As SQLULEN) As SQLRETURN
756
757Declare Function SQLSetCursorName Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
758 CursorName As *SQLCHAR, NameLength As SQLSMALLINT) As SQLRETURN
759
760Declare Function SQLSetDescField Lib "odbc32.dll" (DescriptorHandle As SQLHDESC,
761 RecNumber As SQLSMALLINT, FieldIdentifier As SQLSMALLINT,
762 Value As SQLPOINTER, BufferLength As SQLINTEGER) As SQLRETURN
763
764Declare Function SQLSetDescRec Lib "odbc32.dll" (DescriptorHandle As SQLHDESC,
765 RecNumber As SQLSMALLINT, iType As SQLSMALLINT,
766 SubType As SQLSMALLINT, Length As SQLLEN,
767 Precision As SQLSMALLINT, Scale As SQLSMALLINT,
768 Data As SQLPOINTER, ByRef StringLength As SQLLEN,
769 ByRef Indicator As SQLLEN) As SQLRETURN
770
771Declare Function SQLSetEnvAttr Lib "odbc32.dll" (EnvironmentHandle As SQLHENV,
772 Attribute As SQLINTEGER, Value As SQLPOINTER,
773 StringLength As SQLINTEGER) As SQLRETURN
774
775Declare Function SQLSetParam Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
776 ParameterNumber As SQLUSMALLINT, ValueType As SQLSMALLINT,
777 ParameterType As SQLSMALLINT, LengthPrecision As SQLULEN,
778 ParameterScale As SQLSMALLINT, ParameterValue As SQLPOINTER,
779 ByRef StrLen_or_Ind As SQLLEN) As SQLRETURN
780
781Declare Function SQLSetStmtAttr Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
782 Attribute As SQLINTEGER, Value As SQLPOINTER,
783 StringLength As SQLINTEGER) As SQLRETURN
784
785Declare Function SQLSetStmtOption Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
786 Option As SQLUSMALLINT, Value As SQLULEN) As SQLRETURN
787
788Declare Function SQLSpecialColumns Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
789 IdentifierType As SQLUSMALLINT, CatalogName As *SQLCHAR,
790 NameLength1 As SQLSMALLINT, SchemaName As *SQLCHAR,
791 NameLength2 As SQLSMALLINT, TableName As *SQLCHAR,
792 NameLength3 As SQLSMALLINT, Scope As SQLUSMALLINT,
793 Nullable As SQLUSMALLINT) As SQLRETURN
794
795Declare Function SQLStatistics Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
796 CatalogName As *SQLCHAR, NameLength1 As SQLSMALLINT,
797 SchemaName As *SQLCHAR, NameLength2 As SQLSMALLINT,
798 TableName As *SQLCHAR, NameLength3 As SQLSMALLINT,
799 Unique As SQLUSMALLINT, Reserved As SQLUSMALLINT) As SQLRETURN
800
801Declare Function SQLTables Lib "odbc32.dll" (StatementHandle As SQLHSTMT,
802 CatalogName As *SQLCHAR, NameLength1 As SQLSMALLINT,
803 SchemaName As *SQLCHAR, NameLength2 As SQLSMALLINT,
804 TableName As *SQLCHAR, NameLength3 As SQLSMALLINT,
805 TableType As *SQLCHAR, NameLength4 As SQLSMALLINT) As SQLRETURN
806
807Declare Function SQLTransact Lib "odbc32.dll" (EnvironmentHandle As SQLHENV,
808 ConnectionHandle As SQLHDBC, CompletionType As SQLUSMALLINT) As SQLRETURN
809
810
811#endif '_INC_SQL
Note: See TracBrowser for help on using the repository browser.