source: trunk/ab5.0/ablib/src/api_sql.sbp @ 560

Last change on this file since 560 was 497, checked in by イグトランス (egtra), 15 years ago

インクルードガードとその他不要な前処理定義などの削除

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