source: trunk/Include/api_sql.sbp@ 356

Last change on this file since 356 was 337, checked in by dai, 17 years ago

index.abを一つにまとめた。

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