intersys 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,113 @@
1
+ module Intersys
2
+ # Module reflection keeps classes required to get information
3
+ # about methods and properties of Cache classes
4
+ module Reflection
5
+
6
+ # This class is basic reflection class
7
+ # If has class method Open(class_name), that creates instance of
8
+ # this class, representing its internals
9
+ #
10
+ # Usually creates via Intersys::Object.reflector
11
+ #
12
+ # Then it is possible to call such methods as _methods, properties
13
+ # to get access to methods and properties of Cache class
14
+ class ClassDefinition < Intersys::Object
15
+ class_name "%Dictionary.ClassDefinition"
16
+
17
+ # After all changes to class definition required to call save
18
+ def save
19
+ intersys_call("%Save")
20
+ end
21
+
22
+ # short alias to intersys_get("Methods")
23
+ def _methods
24
+ @methods ||= intersys_get("Methods")
25
+ end
26
+
27
+ def properties
28
+ @properties ||= intersys_get("Properties")
29
+ end
30
+
31
+ def all_methods
32
+ _methods.to_a + self.super.split(",").map do |klass|
33
+ klass = klass.strip
34
+ if match_data = klass.match(/^%([^\.]+)$/)
35
+ klass = "%Library.#{match_data.captures.first}"
36
+ end
37
+ self.class.open(klass).all_methods
38
+ end.flatten
39
+ end
40
+ end
41
+
42
+ class PropertyDefinition < Intersys::Object
43
+ class_name "%Dictionary.PropertyDefinition"
44
+ end
45
+
46
+ class MethodDefinition < Intersys::Object
47
+ class_name "%Dictionary.MethodDefinition"
48
+ end
49
+
50
+ # This is a proxy object to Cache RelationshipObject, which is just like Rails Association object
51
+ #
52
+ class RelationshipObject < Intersys::Object
53
+ class_name "%Library.RelationshipObject"
54
+
55
+ def empty?
56
+ @empty ||= intersys_call("IsEmpty")
57
+ end
58
+
59
+ def count
60
+ @count ||= intersys_call("Count")
61
+ end
62
+ alias :size :count
63
+
64
+ def [](index)
65
+ return @list[index] if @loaded
66
+ intersys_call("GetAt", (index+1).to_s)
67
+ end
68
+
69
+ def each
70
+ 0.upto(count-1) do |i|
71
+ yield self[i]
72
+ end
73
+ end
74
+
75
+ include Enumerable
76
+
77
+ def to_a
78
+ load_list
79
+ end
80
+
81
+ def include?(obj)
82
+ load_list.include?(obj)
83
+ end
84
+
85
+ def inspect
86
+ load_list.inspect
87
+ end
88
+ alias :to_s :inspect
89
+
90
+ def <<(object)
91
+ intersys_call("Insert", object)
92
+ end
93
+ alias :insert :<<
94
+
95
+ def reload
96
+ @list = nil
97
+ @loaded = nil
98
+ @empty = nil
99
+ @count = nil
100
+ end
101
+
102
+ protected
103
+ def load_list
104
+ @list ||= []
105
+ self.each do |prop|
106
+ @list << prop.intersys_get("Name")
107
+ end unless @loaded
108
+ @loaded = true
109
+ @list
110
+ end
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,149 @@
1
+ /*
2
+ * iodbcunix.h
3
+ *
4
+ * $Id: iodbcunix.h,v 1.1 2004/11/11 01:52:36 luesang Exp $
5
+ *
6
+ * ODBC defines for Unix
7
+ *
8
+ * The iODBC driver manager.
9
+ *
10
+ * Copyright (C) 1995 by Ke Jin <kejin@empress.com>
11
+ * Copyright (C) 1996-2004 by OpenLink Software <iodbc@openlinksw.com>
12
+ * All Rights Reserved.
13
+ *
14
+ * This software is released under the terms of either of the following
15
+ * licenses:
16
+ *
17
+ * - GNU Library General Public License (see LICENSE.LGPL)
18
+ * - The BSD License (see LICENSE.BSD).
19
+ *
20
+ * While not mandated by the BSD license, any patches you make to the
21
+ * iODBC source code may be contributed back into the iODBC project
22
+ * at your discretion. Contributions will benefit the Open Source and
23
+ * Data Access community as a whole. Submissions may be made at:
24
+ *
25
+ * http://www.iodbc.org
26
+ *
27
+ *
28
+ * GNU Library Generic Public License Version 2
29
+ * ============================================
30
+ * This library is free software; you can redistribute it and/or
31
+ * modify it under the terms of the GNU Library General Public
32
+ * License as published by the Free Software Foundation; either
33
+ * version 2 of the License, or (at your option) any later version.
34
+ *
35
+ * This library is distributed in the hope that it will be useful,
36
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
37
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
38
+ * Library General Public License for more details.
39
+ *
40
+ * You should have received a copy of the GNU Library General Public
41
+ * License along with this library; if not, write to the Free
42
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
43
+ *
44
+ *
45
+ * The BSD License
46
+ * ===============
47
+ * Redistribution and use in source and binary forms, with or without
48
+ * modification, are permitted provided that the following conditions
49
+ * are met:
50
+ *
51
+ * 1. Redistributions of source code must retain the above copyright
52
+ * notice, this list of conditions and the following disclaimer.
53
+ * 2. Redistributions in binary form must reproduce the above copyright
54
+ * notice, this list of conditions and the following disclaimer in
55
+ * the documentation and/or other materials provided with the
56
+ * distribution.
57
+ * 3. Neither the name of OpenLink Software Inc. nor the names of its
58
+ * contributors may be used to endorse or promote products derived
59
+ * from this software without specific prior written permission.
60
+ *
61
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
62
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
63
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
64
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OPENLINK OR
65
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
66
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
67
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
68
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
69
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
70
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
71
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
72
+ */
73
+ #ifndef _IODBCUNIX_H
74
+ #define _IODBCUNIX_H
75
+
76
+ /*
77
+ * Standard header files
78
+ */
79
+ #include <stdlib.h>
80
+ #include <unistd.h>
81
+
82
+ /*
83
+ * Windows-style declarations
84
+ */
85
+ #define NEAR
86
+ #define FAR
87
+ #define EXPORT
88
+ #define PASCAL
89
+ #define VOID void
90
+ #define CALLBACK
91
+ #define _cdecl
92
+ #define __stdcall
93
+
94
+
95
+ /*
96
+ * Boolean support
97
+ */
98
+ #ifndef TRUE
99
+ #define TRUE 1
100
+ #endif
101
+ #ifndef FALSE
102
+ #define FALSE 0
103
+ #endif
104
+
105
+
106
+ #ifdef __cplusplus
107
+ extern "C" {
108
+ #endif
109
+
110
+
111
+ /*
112
+ * Windows-style typedefs
113
+ */
114
+ #if defined (OBSOLETE_WINDOWS_TYPES)
115
+ typedef unsigned char BYTE;
116
+ #endif
117
+ typedef unsigned short WORD;
118
+ typedef unsigned int DWORD;
119
+ typedef char * LPSTR;
120
+ typedef const char * LPCSTR;
121
+ typedef wchar_t * LPWSTR;
122
+ typedef DWORD * LPDWORD;
123
+
124
+ #if !defined(BOOL) && !defined(_OBJC_OBJC_H_)
125
+ typedef int BOOL;
126
+ #endif
127
+
128
+
129
+ /*
130
+ * Determine sizeof(long) in case it is not determined by configure/config.h
131
+ */
132
+ #ifndef SIZEOF_LONG
133
+ #if defined (_LP64) || \
134
+ defined (__LP64__) || \
135
+ defined (__64BIT__) || \
136
+ defined (__alpha) || \
137
+ defined (__sparcv9) || \
138
+ defined (__arch64__)
139
+ #define SIZEOF_LONG 8 /* 64 bit operating systems */
140
+ #else
141
+ #define SIZEOF_LONG 4 /* 32 bit operating systems */
142
+ #endif
143
+ #endif /* SIZEOF_LONG */
144
+
145
+ #ifdef __cplusplus
146
+ }
147
+ #endif
148
+
149
+ #endif /* _IODBCUNIX_H */
@@ -0,0 +1,1189 @@
1
+ /*
2
+ * sql.h
3
+ *
4
+ * $Id: sql.h,v 1.3 2004/11/11 01:52:36 luesang Exp $
5
+ *
6
+ * ODBC defines
7
+ *
8
+ * The iODBC driver manager.
9
+ *
10
+ * Copyright (C) 1995 by Ke Jin <kejin@empress.com>
11
+ * Copyright (C) 1996-2002 by OpenLink Software <iodbc@openlinksw.com>
12
+ * All Rights Reserved.
13
+ *
14
+ * This software is released under the terms of either of the following
15
+ * licenses:
16
+ *
17
+ * - GNU Library General Public License (see LICENSE.LGPL)
18
+ * - The BSD License (see LICENSE.BSD).
19
+ *
20
+ * While not mandated by the BSD license, any patches you make to the
21
+ * iODBC source code may be contributed back into the iODBC project
22
+ * at your discretion. Contributions will benefit the Open Source and
23
+ * Data Access community as a whole. Submissions may be made at:
24
+ *
25
+ * http://www.iodbc.org
26
+ *
27
+ *
28
+ * GNU Library Generic Public License Version 2
29
+ * ============================================
30
+ * This library is free software; you can redistribute it and/or
31
+ * modify it under the terms of the GNU Library General Public
32
+ * License as published by the Free Software Foundation; either
33
+ * version 2 of the License, or (at your option) any later version.
34
+ *
35
+ * This library is distributed in the hope that it will be useful,
36
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
37
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
38
+ * Library General Public License for more details.
39
+ *
40
+ * You should have received a copy of the GNU Library General Public
41
+ * License along with this library; if not, write to the Free
42
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
43
+ *
44
+ *
45
+ * The BSD License
46
+ * ===============
47
+ * Redistribution and use in source and binary forms, with or without
48
+ * modification, are permitted provided that the following conditions
49
+ * are met:
50
+ *
51
+ * 1. Redistributions of source code must retain the above copyright
52
+ * notice, this list of conditions and the following disclaimer.
53
+ * 2. Redistributions in binary form must reproduce the above copyright
54
+ * notice, this list of conditions and the following disclaimer in
55
+ * the documentation and/or other materials provided with the
56
+ * distribution.
57
+ * 3. Neither the name of OpenLink Software Inc. nor the names of its
58
+ * contributors may be used to endorse or promote products derived
59
+ * from this software without specific prior written permission.
60
+ *
61
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
62
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
63
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
64
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OPENLINK OR
65
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
66
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
67
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
68
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
69
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
70
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
71
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
72
+ */
73
+ #ifndef _SQL_H
74
+ #define _SQL_H
75
+
76
+ /*
77
+ * Set default specification to ODBC 3.51
78
+ */
79
+ #ifndef ODBCVER
80
+ #define ODBCVER 0x0351
81
+ #endif
82
+
83
+ /*
84
+ * Include Windows style defines and typedefs on Unix
85
+ */
86
+ #ifndef _IODBCUNIX_H
87
+ #include <iodbcunix.h>
88
+ #endif
89
+
90
+ #ifndef _SQLTYPES_H
91
+ #include <sqltypes.h>
92
+ #endif
93
+
94
+ #ifdef __cplusplus
95
+ extern "C" {
96
+ #endif
97
+
98
+ /*
99
+ * Useful Constants
100
+ */
101
+ #define SQL_MAX_MESSAGE_LENGTH 512
102
+
103
+
104
+ /*
105
+ * Handle types
106
+ */
107
+ #if (ODBCVER >= 0x0300)
108
+ #define SQL_HANDLE_ENV 1
109
+ #define SQL_HANDLE_DBC 2
110
+ #define SQL_HANDLE_STMT 3
111
+ #define SQL_HANDLE_DESC 4
112
+ #endif /* ODBCVER >= 0x0300 */
113
+
114
+
115
+ /*
116
+ * Function return codes
117
+ */
118
+ #define SQL_SUCCESS 0
119
+ #define SQL_SUCCESS_WITH_INFO 1
120
+ #define SQL_STILL_EXECUTING 2
121
+ #define SQL_ERROR (-1)
122
+ #define SQL_INVALID_HANDLE (-2)
123
+ #define SQL_NEED_DATA 99
124
+ #if (ODBCVER >= 0x0300)
125
+ #define SQL_NO_DATA 100
126
+ #endif /* ODBCVER >= 0x0300 */
127
+
128
+
129
+ /*
130
+ * Test for SQL_SUCCESS or SQL_SUCCESS_WITH_INFO
131
+ */
132
+ #define SQL_SUCCEEDED(rc) (((rc) & (~1)) == 0)
133
+
134
+
135
+ /*
136
+ * Special length values
137
+ */
138
+ #define SQL_NULL_DATA (-1)
139
+ #define SQL_DATA_AT_EXEC (-2)
140
+
141
+
142
+ /*
143
+ * Flags for null-terminated strings
144
+ */
145
+ #define SQL_NTS (-3)
146
+ #define SQL_NTSL (-3L)
147
+
148
+
149
+ /*
150
+ * Standard SQL datatypes, using ANSI type numbering
151
+ */
152
+ #define SQL_UNKNOWN_TYPE 0
153
+ #define SQL_CHAR 1
154
+ #define SQL_NUMERIC 2
155
+ #define SQL_DECIMAL 3
156
+ #define SQL_INTEGER 4
157
+ #define SQL_SMALLINT 5
158
+ #define SQL_FLOAT 6
159
+ #define SQL_REAL 7
160
+ #define SQL_DOUBLE 8
161
+ #if (ODBCVER >= 0x0300)
162
+ #define SQL_DATETIME 9
163
+ #endif /* ODBCVER >= 0x0300 */
164
+ #define SQL_VARCHAR 12
165
+
166
+
167
+ /*
168
+ * SQLGetTypeInfo request for all data types
169
+ */
170
+ #define SQL_ALL_TYPES 0
171
+
172
+
173
+ /*
174
+ * Statement attribute values for date/time data types
175
+ */
176
+ #if (ODBCVER >= 0x0300)
177
+ #define SQL_TYPE_DATE 91
178
+ #define SQL_TYPE_TIME 92
179
+ #define SQL_TYPE_TIMESTAMP 93
180
+ #endif /* ODBCVER >= 0x0300 */
181
+
182
+
183
+ /*
184
+ * Date/Time length constants
185
+ */
186
+ #if (ODBCVER >= 0x0300)
187
+ #define SQL_DATE_LEN 10
188
+ #define SQL_TIME_LEN 8 /* add P+1 if prec >0 */
189
+ #define SQL_TIMESTAMP_LEN 19 /* add P+1 if prec >0 */
190
+ #endif /* ODBCVER >= 0x0300 */
191
+
192
+
193
+ /*
194
+ * NULL status constants
195
+ */
196
+ #define SQL_NO_NULLS 0
197
+ #define SQL_NULLABLE 1
198
+ #define SQL_NULLABLE_UNKNOWN 2
199
+
200
+
201
+ /*
202
+ * NULL Handles
203
+ */
204
+ #define SQL_NULL_HENV 0
205
+ #define SQL_NULL_HDBC 0
206
+ #define SQL_NULL_HSTMT 0
207
+ #if (ODBCVER >= 0x0300)
208
+ #define SQL_NULL_HDESC 0
209
+ #endif /* ODBCVER >= 0x0300 */
210
+
211
+
212
+ /*
213
+ * NULL handle for parent argument to SQLAllocHandle when allocating
214
+ * a SQLHENV
215
+ */
216
+ #if (ODBCVER >= 0x0300)
217
+ #define SQL_NULL_HANDLE 0L
218
+ #endif /* ODBCVER >= 0x0300 */
219
+
220
+
221
+ /*
222
+ * CLI option values
223
+ */
224
+ #if (ODBCVER >= 0x0300)
225
+ #define SQL_FALSE 0
226
+ #define SQL_TRUE 1
227
+ #endif /* ODBCVER >= 0x0300 */
228
+
229
+
230
+ /*
231
+ * Default conversion code for SQLBindCol(), SQLBindParam() and SQLGetData()
232
+ */
233
+ #if (ODBCVER >= 0x0300)
234
+ #define SQL_DEFAULT 99
235
+ #endif /* ODBCVER >= 0x0300 */
236
+
237
+
238
+ /*
239
+ * SQLDataSources/SQLFetchScroll - FetchOrientation
240
+ */
241
+ #define SQL_FETCH_NEXT 1
242
+ #define SQL_FETCH_FIRST 2
243
+
244
+
245
+ /*
246
+ * SQLFetchScroll - FetchOrientation
247
+ */
248
+ #define SQL_FETCH_LAST 3
249
+ #define SQL_FETCH_PRIOR 4
250
+ #define SQL_FETCH_ABSOLUTE 5
251
+ #define SQL_FETCH_RELATIVE 6
252
+
253
+
254
+ /*
255
+ * SQLFreeStmt
256
+ */
257
+ #define SQL_CLOSE 0
258
+ #define SQL_DROP 1
259
+ #define SQL_UNBIND 2
260
+ #define SQL_RESET_PARAMS 3
261
+
262
+
263
+ /*
264
+ * SQLGetConnectAttr - connection attributes
265
+ */
266
+ #if (ODBCVER >= 0x0300)
267
+ #define SQL_ATTR_AUTO_IPD 10001
268
+ #define SQL_ATTR_METADATA_ID 10014
269
+ #endif /* ODBCVER >= 0x0300 */
270
+
271
+
272
+ /*
273
+ * SQLGetData() code indicating that the application row descriptor
274
+ * specifies the data type
275
+ */
276
+ #if (ODBCVER >= 0x0300)
277
+ #define SQL_ARD_TYPE (-99)
278
+ #endif /* ODBCVER >= 0x0300 */
279
+
280
+
281
+ /*
282
+ * SQLGetDescField - identifiers of fields in the SQL descriptor
283
+ */
284
+ #if (ODBCVER >= 0x0300)
285
+ #define SQL_DESC_COUNT 1001
286
+ #define SQL_DESC_TYPE 1002
287
+ #define SQL_DESC_LENGTH 1003
288
+ #define SQL_DESC_OCTET_LENGTH_PTR 1004
289
+ #define SQL_DESC_PRECISION 1005
290
+ #define SQL_DESC_SCALE 1006
291
+ #define SQL_DESC_DATETIME_INTERVAL_CODE 1007
292
+ #define SQL_DESC_NULLABLE 1008
293
+ #define SQL_DESC_INDICATOR_PTR 1009
294
+ #define SQL_DESC_DATA_PTR 1010
295
+ #define SQL_DESC_NAME 1011
296
+ #define SQL_DESC_UNNAMED 1012
297
+ #define SQL_DESC_OCTET_LENGTH 1013
298
+ #define SQL_DESC_ALLOC_TYPE 1099
299
+ #endif /* ODBCVER >= 0x0300 */
300
+
301
+
302
+ /*
303
+ * SQLGetDescField - SQL_DESC_ALLOC_TYPE
304
+ */
305
+ #if (ODBCVER >= 0x0300)
306
+ #define SQL_DESC_ALLOC_AUTO 1
307
+ #define SQL_DESC_ALLOC_USER 2
308
+ #endif /* ODBCVER >= 0x0300 */
309
+
310
+
311
+ /*
312
+ * SQLGetDescField - SQL_DESC_DATETIME_INTERVAL_CODE
313
+ */
314
+ #if (ODBCVER >= 0x0300)
315
+ #define SQL_CODE_DATE 1
316
+ #define SQL_CODE_TIME 2
317
+ #define SQL_CODE_TIMESTAMP 3
318
+ #endif /* ODBCVER >= 0x0300 */
319
+
320
+
321
+ /*
322
+ * SQLGetDescField - SQL_DESC_UNNAMED
323
+ */
324
+ #if (ODBCVER >= 0x0300)
325
+ #define SQL_NAMED 0
326
+ #define SQL_UNNAMED 1
327
+ #endif /* ODBCVER >= 0x0300 */
328
+
329
+
330
+ /*
331
+ * SQLGetDiagField - identifiers of fields in the diagnostics area
332
+ */
333
+ #if (ODBCVER >= 0x0300)
334
+ #define SQL_DIAG_RETURNCODE 1
335
+ #define SQL_DIAG_NUMBER 2
336
+ #define SQL_DIAG_ROW_COUNT 3
337
+ #define SQL_DIAG_SQLSTATE 4
338
+ #define SQL_DIAG_NATIVE 5
339
+ #define SQL_DIAG_MESSAGE_TEXT 6
340
+ #define SQL_DIAG_DYNAMIC_FUNCTION 7
341
+ #define SQL_DIAG_CLASS_ORIGIN 8
342
+ #define SQL_DIAG_SUBCLASS_ORIGIN 9
343
+ #define SQL_DIAG_CONNECTION_NAME 10
344
+ #define SQL_DIAG_SERVER_NAME 11
345
+ #define SQL_DIAG_DYNAMIC_FUNCTION_CODE 12
346
+ #endif /* ODBCVER >= 0x0300 */
347
+
348
+
349
+ /*
350
+ * SQLGetDiagField - SQL_DIAG_DYNAMIC_FUNCTION_CODE
351
+ */
352
+ #if (ODBCVER >= 0x0300)
353
+ #define SQL_DIAG_ALTER_DOMAIN 3
354
+ #define SQL_DIAG_ALTER_TABLE 4
355
+ #define SQL_DIAG_CALL 7
356
+ #define SQL_DIAG_CREATE_ASSERTION 6
357
+ #define SQL_DIAG_CREATE_CHARACTER_SET 8
358
+ #define SQL_DIAG_CREATE_COLLATION 10
359
+ #define SQL_DIAG_CREATE_DOMAIN 23
360
+ #define SQL_DIAG_CREATE_INDEX (-1)
361
+ #define SQL_DIAG_CREATE_SCHEMA 64
362
+ #define SQL_DIAG_CREATE_TABLE 77
363
+ #define SQL_DIAG_CREATE_TRANSLATION 79
364
+ #define SQL_DIAG_CREATE_VIEW 84
365
+ #define SQL_DIAG_DELETE_WHERE 19
366
+ #define SQL_DIAG_DROP_ASSERTION 24
367
+ #define SQL_DIAG_DROP_CHARACTER_SET 25
368
+ #define SQL_DIAG_DROP_COLLATION 26
369
+ #define SQL_DIAG_DROP_DOMAIN 27
370
+ #define SQL_DIAG_DROP_INDEX (-2)
371
+ #define SQL_DIAG_DROP_SCHEMA 31
372
+ #define SQL_DIAG_DROP_TABLE 32
373
+ #define SQL_DIAG_DROP_TRANSLATION 33
374
+ #define SQL_DIAG_DROP_VIEW 36
375
+ #define SQL_DIAG_DYNAMIC_DELETE_CURSOR 38
376
+ #define SQL_DIAG_DYNAMIC_UPDATE_CURSOR 81
377
+ #define SQL_DIAG_GRANT 48
378
+ #define SQL_DIAG_INSERT 50
379
+ #define SQL_DIAG_REVOKE 59
380
+ #define SQL_DIAG_SELECT_CURSOR 85
381
+ #define SQL_DIAG_UNKNOWN_STATEMENT 0
382
+ #define SQL_DIAG_UPDATE_WHERE 82
383
+ #endif /* ODBCVER >= 0x0300 */
384
+
385
+
386
+ /*
387
+ * SQLGetEnvAttr - environment attribute
388
+ */
389
+ #if (ODBCVER >= 0x0300)
390
+ #define SQL_ATTR_OUTPUT_NTS 10001
391
+ #endif /* ODBCVER >= 0x0300 */
392
+
393
+
394
+ /*
395
+ * SQLGetFunctions
396
+ */
397
+ #define SQL_API_SQLALLOCCONNECT 1
398
+ #define SQL_API_SQLALLOCENV 2
399
+ #if (ODBCVER >= 0x0300)
400
+ #define SQL_API_SQLALLOCHANDLE 1001
401
+ #endif /* ODBCVER >= 0x0300 */
402
+ #define SQL_API_SQLALLOCSTMT 3
403
+ #define SQL_API_SQLBINDCOL 4
404
+ #if (ODBCVER >= 0x0300)
405
+ #define SQL_API_SQLBINDPARAM 1002
406
+ #endif /* ODBCVER >= 0x0300 */
407
+ #define SQL_API_SQLCANCEL 5
408
+ #if (ODBCVER >= 0x0300)
409
+ #define SQL_API_SQLCLOSECURSOR 1003
410
+ #define SQL_API_SQLCOLATTRIBUTE 6
411
+ #endif /* ODBCVER >= 0x0300 */
412
+ #define SQL_API_SQLCOLUMNS 40
413
+ #define SQL_API_SQLCONNECT 7
414
+ #if (ODBCVER >= 0x0300)
415
+ #define SQL_API_SQLCOPYDESC 1004
416
+ #endif /* ODBCVER >= 0x0300 */
417
+ #define SQL_API_SQLDATASOURCES 57
418
+ #define SQL_API_SQLDESCRIBECOL 8
419
+ #define SQL_API_SQLDISCONNECT 9
420
+ #if (ODBCVER >= 0x0300)
421
+ #define SQL_API_SQLENDTRAN 1005
422
+ #endif /* ODBCVER >= 0x0300 */
423
+ #define SQL_API_SQLERROR 10
424
+ #define SQL_API_SQLEXECDIRECT 11
425
+ #define SQL_API_SQLEXECUTE 12
426
+ #define SQL_API_SQLFETCH 13
427
+ #if (ODBCVER >= 0x0300)
428
+ #define SQL_API_SQLFETCHSCROLL 1021
429
+ #endif /* ODBCVER >= 0x0300 */
430
+ #define SQL_API_SQLFREECONNECT 14
431
+ #define SQL_API_SQLFREEENV 15
432
+ #if (ODBCVER >= 0x0300)
433
+ #define SQL_API_SQLFREEHANDLE 1006
434
+ #endif /* ODBCVER >= 0x0300 */
435
+ #define SQL_API_SQLFREESTMT 16
436
+ #if (ODBCVER >= 0x0300)
437
+ #define SQL_API_SQLGETCONNECTATTR 1007
438
+ #endif /* ODBCVER >= 0x0300 */
439
+ #define SQL_API_SQLGETCONNECTOPTION 42
440
+ #define SQL_API_SQLGETCURSORNAME 17
441
+ #define SQL_API_SQLGETDATA 43
442
+ #if (ODBCVER >= 0x0300)
443
+ #define SQL_API_SQLGETDESCFIELD 1008
444
+ #define SQL_API_SQLGETDESCREC 1009
445
+ #define SQL_API_SQLGETDIAGFIELD 1010
446
+ #define SQL_API_SQLGETDIAGREC 1011
447
+ #define SQL_API_SQLGETENVATTR 1012
448
+ #endif /* ODBCVER >= 0x0300 */
449
+ #define SQL_API_SQLGETFUNCTIONS 44
450
+ #define SQL_API_SQLGETINFO 45
451
+ #if (ODBCVER >= 0x0300)
452
+ #define SQL_API_SQLGETSTMTATTR 1014
453
+ #endif /* ODBCVER >= 0x0300 */
454
+ #define SQL_API_SQLGETSTMTOPTION 46
455
+ #define SQL_API_SQLGETTYPEINFO 47
456
+ #define SQL_API_SQLNUMRESULTCOLS 18
457
+ #define SQL_API_SQLPARAMDATA 48
458
+ #define SQL_API_SQLPREPARE 19
459
+ #define SQL_API_SQLPUTDATA 49
460
+ #define SQL_API_SQLROWCOUNT 20
461
+ #if (ODBCVER >= 0x0300)
462
+ #define SQL_API_SQLSETCONNECTATTR 1016
463
+ #endif /* ODBCVER >= 0x0300 */
464
+ #define SQL_API_SQLSETCONNECTOPTION 50
465
+ #define SQL_API_SQLSETCURSORNAME 21
466
+ #if (ODBCVER >= 0x0300)
467
+ #define SQL_API_SQLSETDESCFIELD 1017
468
+ #define SQL_API_SQLSETDESCREC 1018
469
+ #define SQL_API_SQLSETENVATTR 1019
470
+ #endif /* ODBCVER >= 0x0300 */
471
+ #define SQL_API_SQLSETPARAM 22
472
+ #if (ODBCVER >= 0x0300)
473
+ #define SQL_API_SQLSETSTMTATTR 1020
474
+ #endif /* ODBCVER >= 0x0300 */
475
+ #define SQL_API_SQLSETSTMTOPTION 51
476
+ #define SQL_API_SQLSPECIALCOLUMNS 52
477
+ #define SQL_API_SQLSTATISTICS 53
478
+ #define SQL_API_SQLTABLES 54
479
+ #define SQL_API_SQLTRANSACT 23
480
+
481
+
482
+ /*
483
+ * SQLGetInfo
484
+ */
485
+ #if (ODBCVER >= 0x0300)
486
+ #define SQL_MAX_DRIVER_CONNECTIONS 0
487
+ #define SQL_MAXIMUM_DRIVER_CONNECTIONS SQL_MAX_DRIVER_CONNECTIONS
488
+ #define SQL_MAX_CONCURRENT_ACTIVITIES 1
489
+ #define SQL_MAXIMUM_CONCURRENT_ACTIVITIES SQL_MAX_CONCURRENT_ACTIVITIES
490
+ #endif /* ODBCVER >= 0x0300 */
491
+ #define SQL_DATA_SOURCE_NAME 2
492
+ #define SQL_FETCH_DIRECTION 8
493
+ #define SQL_SERVER_NAME 13
494
+ #define SQL_SEARCH_PATTERN_ESCAPE 14
495
+ #define SQL_DBMS_NAME 17
496
+ #define SQL_DBMS_VER 18
497
+ #define SQL_ACCESSIBLE_TABLES 19
498
+ #define SQL_ACCESSIBLE_PROCEDURES 20
499
+ #define SQL_CURSOR_COMMIT_BEHAVIOR 23
500
+ #define SQL_DATA_SOURCE_READ_ONLY 25
501
+ #define SQL_DEFAULT_TXN_ISOLATION 26
502
+ #define SQL_IDENTIFIER_CASE 28
503
+ #define SQL_IDENTIFIER_QUOTE_CHAR 29
504
+ #define SQL_MAX_COLUMN_NAME_LEN 30
505
+ #define SQL_MAXIMUM_COLUMN_NAME_LENGTH SQL_MAX_COLUMN_NAME_LEN
506
+ #define SQL_MAX_CURSOR_NAME_LEN 31
507
+ #define SQL_MAXIMUM_CURSOR_NAME_LENGTH SQL_MAX_CURSOR_NAME_LEN
508
+ #define SQL_MAX_SCHEMA_NAME_LEN 32
509
+ #define SQL_MAXIMUM_SCHEMA_NAME_LENGTH SQL_MAX_SCHEMA_NAME_LEN
510
+ #define SQL_MAX_CATALOG_NAME_LEN 34
511
+ #define SQL_MAXIMUM_CATALOG_NAME_LENGTH SQL_MAX_CATALOG_NAME_LEN
512
+ #define SQL_MAX_TABLE_NAME_LEN 35
513
+ #define SQL_SCROLL_CONCURRENCY 43
514
+ #define SQL_TXN_CAPABLE 46
515
+ #define SQL_TRANSACTION_CAPABLE SQL_TXN_CAPABLE
516
+ #define SQL_USER_NAME 47
517
+ #define SQL_TXN_ISOLATION_OPTION 72
518
+ #define SQL_TRANSACTION_ISOLATION_OPTION SQL_TXN_ISOLATION_OPTION
519
+ #define SQL_INTEGRITY 73
520
+ #define SQL_GETDATA_EXTENSIONS 81
521
+ #define SQL_NULL_COLLATION 85
522
+ #define SQL_ALTER_TABLE 86
523
+ #define SQL_ORDER_BY_COLUMNS_IN_SELECT 90
524
+ #define SQL_SPECIAL_CHARACTERS 94
525
+ #define SQL_MAX_COLUMNS_IN_GROUP_BY 97
526
+ #define SQL_MAXIMUM_COLUMNS_IN_GROUP_BY SQL_MAX_COLUMNS_IN_GROUP_BY
527
+ #define SQL_MAX_COLUMNS_IN_INDEX 98
528
+ #define SQL_MAXIMUM_COLUMNS_IN_INDEX SQL_MAX_COLUMNS_IN_INDEX
529
+ #define SQL_MAX_COLUMNS_IN_ORDER_BY 99
530
+ #define SQL_MAXIMUM_COLUMNS_IN_ORDER_BY SQL_MAX_COLUMNS_IN_ORDER_BY
531
+ #define SQL_MAX_COLUMNS_IN_SELECT 100
532
+ #define SQL_MAXIMUM_COLUMNS_IN_SELECT SQL_MAX_COLUMNS_IN_SELECT
533
+ #define SQL_MAX_COLUMNS_IN_TABLE 101
534
+ #define SQL_MAX_INDEX_SIZE 102
535
+ #define SQL_MAXIMUM_INDEX_SIZE SQL_MAX_INDEX_SIZE
536
+ #define SQL_MAX_ROW_SIZE 104
537
+ #define SQL_MAXIMUM_ROW_SIZE SQL_MAX_ROW_SIZE
538
+ #define SQL_MAX_STATEMENT_LEN 105
539
+ #define SQL_MAXIMUM_STATEMENT_LENGTH SQL_MAX_STATEMENT_LEN
540
+ #define SQL_MAX_TABLES_IN_SELECT 106
541
+ #define SQL_MAXIMUM_TABLES_IN_SELECT SQL_MAX_TABLES_IN_SELECT
542
+ #define SQL_MAX_USER_NAME_LEN 107
543
+ #define SQL_MAXIMUM_USER_NAME_LENGTH SQL_MAX_USER_NAME_LEN
544
+ #if (ODBCVER >= 0x0300)
545
+ #define SQL_OJ_CAPABILITIES 115
546
+ #define SQL_OUTER_JOIN_CAPABILITIES SQL_OJ_CAPABILITIES
547
+ #endif /* ODBCVER >= 0x0300 */
548
+
549
+ #if (ODBCVER >= 0x0300)
550
+ #define SQL_XOPEN_CLI_YEAR 10000
551
+ #define SQL_CURSOR_SENSITIVITY 10001
552
+ #define SQL_DESCRIBE_PARAMETER 10002
553
+ #define SQL_CATALOG_NAME 10003
554
+ #define SQL_COLLATION_SEQ 10004
555
+ #define SQL_MAX_IDENTIFIER_LEN 10005
556
+ #define SQL_MAXIMUM_IDENTIFIER_LENGTH SQL_MAX_IDENTIFIER_LEN
557
+ #endif /* ODBCVER >= 0x0300 */
558
+
559
+
560
+ /*
561
+ * SQLGetInfo - SQL_ALTER_TABLE
562
+ */
563
+ #if (ODBCVER >= 0x0200)
564
+ #define SQL_AT_ADD_COLUMN 0x00000001L
565
+ #define SQL_AT_DROP_COLUMN 0x00000002L
566
+ #endif /* ODBCVER >= 0x0300 */
567
+
568
+ #if (ODBCVER >= 0x0300)
569
+ #define SQL_AT_ADD_CONSTRAINT 0x00000008L
570
+ /*
571
+ * The following bitmasks are ODBC extensions and defined in sqlext.h:
572
+ *
573
+ * #define SQL_AT_COLUMN_SINGLE 0x00000020L
574
+ * #define SQL_AT_ADD_COLUMN_DEFAULT 0x00000040L
575
+ * #define SQL_AT_ADD_COLUMN_COLLATION 0x00000080L
576
+ * #define SQL_AT_SET_COLUMN_DEFAULT 0x00000100L
577
+ * #define SQL_AT_DROP_COLUMN_DEFAULT 0x00000200L
578
+ * #define SQL_AT_DROP_COLUMN_CASCADE 0x00000400L
579
+ * #define SQL_AT_DROP_COLUMN_RESTRICT 0x00000800L
580
+ * #define SQL_AT_ADD_TABLE_CONSTRAINT 0x00001000L
581
+ * #define SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE 0x00002000L
582
+ * #define SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT 0x00004000L
583
+ * #define SQL_AT_CONSTRAINT_NAME_DEFINITION 0x00008000L
584
+ * #define SQL_AT_CONSTRAINT_INITIALLY_DEFERRED 0x00010000L
585
+ * #define SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE 0x00020000L
586
+ * #define SQL_AT_CONSTRAINT_DEFERRABLE 0x00040000L
587
+ * #define SQL_AT_CONSTRAINT_NON_DEFERRABLE 0x00080000L
588
+ */
589
+ #endif /* ODBCVER >= 0x0300 */
590
+
591
+
592
+ /*
593
+ * SQLGetInfo - SQL_ASYNC_MODE
594
+ */
595
+ #if (ODBCVER >= 0x0300)
596
+ #define SQL_AM_NONE 0
597
+ #define SQL_AM_CONNECTION 1
598
+ #define SQL_AM_STATEMENT 2
599
+ #endif /* ODBCVER >= 0x0300 */
600
+
601
+
602
+ /*
603
+ * SQLGetInfo - SQL_CURSOR_COMMIT_BEHAVIOR
604
+ */
605
+ #define SQL_CB_DELETE 0
606
+ #define SQL_CB_CLOSE 1
607
+ #define SQL_CB_PRESERVE 2
608
+
609
+
610
+ /*
611
+ * SQLGetInfo - SQL_FETCH_DIRECTION
612
+ */
613
+ #define SQL_FD_FETCH_NEXT 0x00000001L
614
+ #define SQL_FD_FETCH_FIRST 0x00000002L
615
+ #define SQL_FD_FETCH_LAST 0x00000004L
616
+ #define SQL_FD_FETCH_PRIOR 0x00000008L
617
+ #define SQL_FD_FETCH_ABSOLUTE 0x00000010L
618
+ #define SQL_FD_FETCH_RELATIVE 0x00000020L
619
+
620
+
621
+ /*
622
+ * SQLGetInfo - SQL_GETDATA_EXTENSIONS
623
+ */
624
+ #define SQL_GD_ANY_COLUMN 0x00000001L
625
+ #define SQL_GD_ANY_ORDER 0x00000002L
626
+
627
+
628
+ /*
629
+ * SQLGetInfo - SQL_IDENTIFIER_CASE
630
+ */
631
+ #define SQL_IC_UPPER 1
632
+ #define SQL_IC_LOWER 2
633
+ #define SQL_IC_SENSITIVE 3
634
+ #define SQL_IC_MIXED 4
635
+
636
+
637
+ /*
638
+ * SQLGetInfo - SQL_NULL_COLLATION
639
+ */
640
+ #define SQL_NC_HIGH 0
641
+ #define SQL_NC_LOW 1
642
+
643
+
644
+ /*
645
+ * SQLGetInfo - SQL_OJ_CAPABILITIES
646
+ */
647
+ #if (ODBCVER >= 0x0201)
648
+ #define SQL_OJ_LEFT 0x00000001L
649
+ #define SQL_OJ_RIGHT 0x00000002L
650
+ #define SQL_OJ_FULL 0x00000004L
651
+ #define SQL_OJ_NESTED 0x00000008L
652
+ #define SQL_OJ_NOT_ORDERED 0x00000010L
653
+ #define SQL_OJ_INNER 0x00000020L
654
+ #define SQL_OJ_ALL_COMPARISON_OPS 0x00000040L
655
+ #endif
656
+
657
+
658
+ /*
659
+ * SQLGetInfo - SQL_SCROLL_CONCURRENCY
660
+ */
661
+ #define SQL_SCCO_READ_ONLY 0x00000001L
662
+ #define SQL_SCCO_LOCK 0x00000002L
663
+ #define SQL_SCCO_OPT_ROWVER 0x00000004L
664
+ #define SQL_SCCO_OPT_VALUES 0x00000008L
665
+
666
+
667
+ /*
668
+ * SQLGetInfo - SQL_TXN_CAPABLE
669
+ */
670
+ #define SQL_TC_NONE 0
671
+ #define SQL_TC_DML 1
672
+ #define SQL_TC_ALL 2
673
+ #define SQL_TC_DDL_COMMIT 3
674
+ #define SQL_TC_DDL_IGNORE 4
675
+
676
+
677
+ /*
678
+ * SQLGetInfo - SQL_TXN_ISOLATION_OPTION
679
+ */
680
+ #define SQL_TXN_READ_UNCOMMITTED 0x00000001L
681
+ #define SQL_TRANSACTION_READ_UNCOMMITTED SQL_TXN_READ_UNCOMMITTED
682
+ #define SQL_TXN_READ_COMMITTED 0x00000002L
683
+ #define SQL_TRANSACTION_READ_COMMITTED SQL_TXN_READ_COMMITTED
684
+ #define SQL_TXN_REPEATABLE_READ 0x00000004L
685
+ #define SQL_TRANSACTION_REPEATABLE_READ SQL_TXN_REPEATABLE_READ
686
+ #define SQL_TXN_SERIALIZABLE 0x00000008L
687
+ #define SQL_TRANSACTION_SERIALIZABLE SQL_TXN_SERIALIZABLE
688
+
689
+
690
+ /*
691
+ * SQLGetStmtAttr - statement attributes
692
+ */
693
+ #if (ODBCVER >= 0x0300)
694
+ #define SQL_ATTR_APP_ROW_DESC 10010
695
+ #define SQL_ATTR_APP_PARAM_DESC 10011
696
+ #define SQL_ATTR_IMP_ROW_DESC 10012
697
+ #define SQL_ATTR_IMP_PARAM_DESC 10013
698
+ #define SQL_ATTR_CURSOR_SCROLLABLE (-1)
699
+ #define SQL_ATTR_CURSOR_SENSITIVITY (-2)
700
+ #endif /* ODBCVER >= 0x0300 */
701
+
702
+
703
+ /*
704
+ * SQLGetStmtAttr - SQL_ATTR_CURSOR_SCROLLABLE
705
+ */
706
+ #if (ODBCVER >= 0x0300)
707
+ #define SQL_NONSCROLLABLE 0
708
+ #define SQL_SCROLLABLE 1
709
+ #endif /* ODBCVER >= 0x0300 */
710
+
711
+
712
+ /*
713
+ * SQLGetStmtAttr - SQL_ATTR_CURSOR_SENSITIVITY
714
+ */
715
+ #if (ODBCVER >= 0x0300)
716
+ #define SQL_UNSPECIFIED 0
717
+ #define SQL_INSENSITIVE 1
718
+ #define SQL_SENSITIVE 2
719
+ #endif /* ODBCVER >= 0x0300 */
720
+
721
+
722
+ /*
723
+ * SQLGetTypeInfo - SEARCHABLE
724
+ */
725
+ #if (ODBCVER >= 0x0300)
726
+ #define SQL_PRED_NONE 0
727
+ #define SQL_PRED_CHAR 1
728
+ #define SQL_PRED_BASIC 2
729
+ #endif /* ODBCVER >= 0x0300 */
730
+
731
+
732
+ /*
733
+ * SQLSpecialColumns - Column scopes
734
+ */
735
+ #define SQL_SCOPE_CURROW 0
736
+ #define SQL_SCOPE_TRANSACTION 1
737
+ #define SQL_SCOPE_SESSION 2
738
+
739
+
740
+ /*
741
+ * SQLSpecialColumns - PSEUDO_COLUMN
742
+ */
743
+ #define SQL_PC_UNKNOWN 0
744
+ #if (ODBCVER >= 0x0300)
745
+ #define SQL_PC_NON_PSEUDO 1
746
+ #endif /* ODBCVER >= 0x0300 */
747
+ #define SQL_PC_PSEUDO 2
748
+
749
+
750
+ /*
751
+ * SQLSpecialColumns - IdentifierType
752
+ */
753
+ #if (ODBCVER >= 0x0300)
754
+ #define SQL_ROW_IDENTIFIER 1
755
+ #endif /* ODBCVER >= 0x0300 */
756
+
757
+
758
+ /*
759
+ * SQLStatistics - fUnique
760
+ */
761
+ #define SQL_INDEX_UNIQUE 0
762
+ #define SQL_INDEX_ALL 1
763
+
764
+
765
+ /*
766
+ * SQLStatistics - TYPE
767
+ */
768
+ #define SQL_INDEX_CLUSTERED 1
769
+ #define SQL_INDEX_HASHED 2
770
+ #define SQL_INDEX_OTHER 3
771
+
772
+
773
+ /*
774
+ * SQLTransact/SQLEndTran
775
+ */
776
+ #define SQL_COMMIT 0
777
+ #define SQL_ROLLBACK 1
778
+
779
+
780
+ /*
781
+ * Function Prototypes
782
+ */
783
+ SQLRETURN SQL_API SQLAllocConnect (
784
+ SQLHENV EnvironmentHandle,
785
+ SQLHDBC * ConnectionHandle);
786
+
787
+ SQLRETURN SQL_API SQLAllocEnv (
788
+ SQLHENV * EnvironmentHandle);
789
+
790
+ #if (ODBCVER >= 0x0300)
791
+ SQLRETURN SQL_API SQLAllocHandle (
792
+ SQLSMALLINT HandleType,
793
+ SQLHANDLE InputHandle,
794
+ SQLHANDLE * OutputHandle);
795
+ #endif /* ODBCVER >= 0x0300 */
796
+
797
+ SQLRETURN SQL_API SQLAllocStmt (
798
+ SQLHDBC ConnectionHandle,
799
+ SQLHSTMT * StatementHandle);
800
+
801
+ SQLRETURN SQL_API SQLBindCol (
802
+ SQLHSTMT StatementHandle,
803
+ SQLUSMALLINT ColumnNumber,
804
+ SQLSMALLINT TargetType,
805
+ SQLPOINTER TargetValue,
806
+ SQLLEN BufferLength,
807
+ SQLLEN * StrLen_or_Ind);
808
+
809
+ #if (ODBCVER >= 0x0300)
810
+ SQLRETURN SQL_API SQLBindParam (
811
+ SQLHSTMT StatementHandle,
812
+ SQLUSMALLINT ParameterNumber,
813
+ SQLSMALLINT ValueType,
814
+ SQLSMALLINT ParameterType,
815
+ SQLULEN LengthPrecision,
816
+ SQLSMALLINT ParameterScale,
817
+ SQLPOINTER ParameterValue,
818
+ SQLLEN * StrLen_or_Ind);
819
+ #endif
820
+
821
+ SQLRETURN SQL_API SQLCancel (
822
+ SQLHSTMT StatementHandle);
823
+
824
+ #if (ODBCVER >= 0x0300)
825
+ SQLRETURN SQL_API SQLCloseCursor (
826
+ SQLHSTMT StatementHandle);
827
+
828
+ /*
829
+ * Using SQLLEN * instead of SQLPOINTER for NumericAttribute,
830
+ * makes the prototype the same as SQLColAttributes (deprecated)
831
+ * and clearer for 64bit ports
832
+ */
833
+ SQLRETURN SQL_API SQLColAttribute (
834
+ SQLHSTMT StatementHandle,
835
+ SQLUSMALLINT ColumnNumber,
836
+ SQLUSMALLINT FieldIdentifier,
837
+ SQLPOINTER CharacterAttribute,
838
+ SQLSMALLINT BufferLength,
839
+ SQLSMALLINT * StringLength,
840
+ SQLLEN * NumericAttribute);
841
+ #endif
842
+
843
+ SQLRETURN SQL_API SQLColumns (
844
+ SQLHSTMT StatementHandle,
845
+ SQLCHAR * CatalogName,
846
+ SQLSMALLINT NameLength1,
847
+ SQLCHAR * SchemaName,
848
+ SQLSMALLINT NameLength2,
849
+ SQLCHAR * TableName,
850
+ SQLSMALLINT NameLength3,
851
+ SQLCHAR * ColumnName,
852
+ SQLSMALLINT NameLength4);
853
+
854
+ SQLRETURN SQL_API SQLConnect (
855
+ SQLHDBC ConnectionHandle,
856
+ SQLCHAR * ServerName,
857
+ SQLSMALLINT NameLength1,
858
+ SQLCHAR * UserName,
859
+ SQLSMALLINT NameLength2,
860
+ SQLCHAR * Authentication,
861
+ SQLSMALLINT NameLength3);
862
+
863
+ #if (ODBCVER >= 0x0300)
864
+ SQLRETURN SQL_API SQLCopyDesc (
865
+ SQLHDESC SourceDescHandle,
866
+ SQLHDESC TargetDescHandle);
867
+ #endif
868
+
869
+ SQLRETURN SQL_API SQLDataSources (
870
+ SQLHENV EnvironmentHandle,
871
+ SQLUSMALLINT Direction,
872
+ SQLCHAR * ServerName,
873
+ SQLSMALLINT BufferLength1,
874
+ SQLSMALLINT * NameLength1,
875
+ SQLCHAR * Description,
876
+ SQLSMALLINT BufferLength2,
877
+ SQLSMALLINT * NameLength2);
878
+
879
+ SQLRETURN SQL_API SQLDescribeCol (
880
+ SQLHSTMT StatementHandle,
881
+ SQLUSMALLINT ColumnNumber,
882
+ SQLCHAR * ColumnName,
883
+ SQLSMALLINT BufferLength,
884
+ SQLSMALLINT * NameLength,
885
+ SQLSMALLINT * DataType,
886
+ SQLULEN * ColumnSize,
887
+ SQLSMALLINT * DecimalDigits,
888
+ SQLSMALLINT * Nullable);
889
+
890
+ SQLRETURN SQL_API SQLDisconnect (
891
+ SQLHDBC ConnectionHandle);
892
+
893
+ #if (ODBCVER >= 0x0300)
894
+ SQLRETURN SQL_API SQLEndTran (
895
+ SQLSMALLINT HandleType,
896
+ SQLHANDLE Handle,
897
+ SQLSMALLINT CompletionType);
898
+ #endif
899
+
900
+ SQLRETURN SQL_API SQLError (
901
+ SQLHENV EnvironmentHandle,
902
+ SQLHDBC ConnectionHandle,
903
+ SQLHSTMT StatementHandle,
904
+ SQLCHAR * Sqlstate,
905
+ SQLINTEGER * NativeError,
906
+ SQLCHAR * MessageText,
907
+ SQLSMALLINT BufferLength,
908
+ SQLSMALLINT * TextLength);
909
+
910
+ SQLRETURN SQL_API SQLExecDirect (
911
+ SQLHSTMT StatementHandle,
912
+ SQLCHAR * StatementText,
913
+ SQLINTEGER TextLength);
914
+
915
+ SQLRETURN SQL_API SQLExecute (
916
+ SQLHSTMT StatementHandle);
917
+
918
+ SQLRETURN SQL_API SQLFetch (
919
+ SQLHSTMT StatementHandle);
920
+
921
+ #if (ODBCVER >= 0x0300)
922
+ SQLRETURN SQL_API SQLFetchScroll (
923
+ SQLHSTMT StatementHandle,
924
+ SQLSMALLINT FetchOrientation,
925
+ SQLLEN FetchOffset);
926
+ #endif
927
+
928
+ SQLRETURN SQL_API SQLFreeConnect (
929
+ SQLHDBC ConnectionHandle);
930
+
931
+ SQLRETURN SQL_API SQLFreeEnv (
932
+ SQLHENV EnvironmentHandle);
933
+
934
+ #if (ODBCVER >= 0x0300)
935
+ SQLRETURN SQL_API SQLFreeHandle (
936
+ SQLSMALLINT HandleType,
937
+ SQLHANDLE Handle);
938
+ #endif
939
+
940
+ SQLRETURN SQL_API SQLFreeStmt (
941
+ SQLHSTMT StatementHandle,
942
+ SQLUSMALLINT Option);
943
+
944
+ #if (ODBCVER >= 0x0300)
945
+ SQLRETURN SQL_API SQLGetConnectAttr (
946
+ SQLHDBC ConnectionHandle,
947
+ SQLINTEGER Attribute,
948
+ SQLPOINTER Value,
949
+ SQLINTEGER BufferLength,
950
+ SQLINTEGER * StringLength);
951
+ #endif
952
+
953
+ SQLRETURN SQL_API SQLGetConnectOption (
954
+ SQLHDBC ConnectionHandle,
955
+ SQLUSMALLINT Option,
956
+ SQLPOINTER Value);
957
+
958
+ SQLRETURN SQL_API SQLGetCursorName (
959
+ SQLHSTMT StatementHandle,
960
+ SQLCHAR * CursorName,
961
+ SQLSMALLINT BufferLength,
962
+ SQLSMALLINT * NameLength);
963
+
964
+ SQLRETURN SQL_API SQLGetData (
965
+ SQLHSTMT StatementHandle,
966
+ SQLUSMALLINT ColumnNumber,
967
+ SQLSMALLINT TargetType,
968
+ SQLPOINTER TargetValue,
969
+ SQLLEN BufferLength,
970
+ SQLLEN * StrLen_or_Ind);
971
+
972
+ #if (ODBCVER >= 0x0300)
973
+ SQLRETURN SQL_API SQLGetDescField (
974
+ SQLHDESC DescriptorHandle,
975
+ SQLSMALLINT RecNumber,
976
+ SQLSMALLINT FieldIdentifier,
977
+ SQLPOINTER Value,
978
+ SQLINTEGER BufferLength,
979
+ SQLINTEGER * StringLength);
980
+
981
+ SQLRETURN SQL_API SQLGetDescRec (
982
+ SQLHDESC DescriptorHandle,
983
+ SQLSMALLINT RecNumber,
984
+ SQLCHAR * Name,
985
+ SQLSMALLINT BufferLength,
986
+ SQLSMALLINT * StringLength,
987
+ SQLSMALLINT * Type,
988
+ SQLSMALLINT * SubType,
989
+ SQLLEN * Length,
990
+ SQLSMALLINT * Precision,
991
+ SQLSMALLINT * Scale,
992
+ SQLSMALLINT * Nullable);
993
+
994
+ SQLRETURN SQL_API SQLGetDiagField (
995
+ SQLSMALLINT HandleType,
996
+ SQLHANDLE Handle,
997
+ SQLSMALLINT RecNumber,
998
+ SQLSMALLINT DiagIdentifier,
999
+ SQLPOINTER DiagInfo,
1000
+ SQLSMALLINT BufferLength,
1001
+ SQLSMALLINT * StringLength);
1002
+
1003
+ SQLRETURN SQL_API SQLGetDiagRec (
1004
+ SQLSMALLINT HandleType,
1005
+ SQLHANDLE Handle,
1006
+ SQLSMALLINT RecNumber,
1007
+ SQLCHAR * Sqlstate,
1008
+ SQLINTEGER * NativeError,
1009
+ SQLCHAR * MessageText,
1010
+ SQLSMALLINT BufferLength,
1011
+ SQLSMALLINT * TextLength);
1012
+
1013
+ SQLRETURN SQL_API SQLGetEnvAttr (
1014
+ SQLHENV EnvironmentHandle,
1015
+ SQLINTEGER Attribute,
1016
+ SQLPOINTER Value,
1017
+ SQLINTEGER BufferLength,
1018
+ SQLINTEGER * StringLength);
1019
+ #endif /* ODBCVER >= 0x0300 */
1020
+
1021
+ SQLRETURN SQL_API SQLGetFunctions (
1022
+ SQLHDBC ConnectionHandle,
1023
+ SQLUSMALLINT FunctionId,
1024
+ SQLUSMALLINT * Supported);
1025
+
1026
+ SQLRETURN SQL_API SQLGetInfo (
1027
+ SQLHDBC ConnectionHandle,
1028
+ SQLUSMALLINT InfoType,
1029
+ SQLPOINTER InfoValue,
1030
+ SQLSMALLINT BufferLength,
1031
+ SQLSMALLINT * StringLength);
1032
+
1033
+ #if (ODBCVER >= 0x0300)
1034
+ SQLRETURN SQL_API SQLGetStmtAttr (
1035
+ SQLHSTMT StatementHandle,
1036
+ SQLINTEGER Attribute,
1037
+ SQLPOINTER Value,
1038
+ SQLINTEGER BufferLength,
1039
+ SQLINTEGER * StringLength);
1040
+ #endif /* ODBCVER >= 0x0300 */
1041
+
1042
+ SQLRETURN SQL_API SQLGetStmtOption (
1043
+ SQLHSTMT StatementHandle,
1044
+ SQLUSMALLINT Option,
1045
+ SQLPOINTER Value);
1046
+
1047
+ SQLRETURN SQL_API SQLGetTypeInfo (
1048
+ SQLHSTMT StatementHandle,
1049
+ SQLSMALLINT DataType);
1050
+
1051
+ SQLRETURN SQL_API SQLNumResultCols (
1052
+ SQLHSTMT StatementHandle,
1053
+ SQLSMALLINT * ColumnCount);
1054
+
1055
+ SQLRETURN SQL_API SQLParamData (
1056
+ SQLHSTMT StatementHandle,
1057
+ SQLPOINTER * Value);
1058
+
1059
+ SQLRETURN SQL_API SQLPrepare (
1060
+ SQLHSTMT StatementHandle,
1061
+ SQLCHAR * StatementText,
1062
+ SQLINTEGER TextLength);
1063
+
1064
+ SQLRETURN SQL_API SQLPutData (
1065
+ SQLHSTMT StatementHandle,
1066
+ SQLPOINTER Data,
1067
+ SQLLEN StrLen_or_Ind);
1068
+
1069
+ SQLRETURN SQL_API SQLRowCount (
1070
+ SQLHSTMT StatementHandle,
1071
+ SQLLEN * RowCount);
1072
+
1073
+ #if (ODBCVER >= 0x0300)
1074
+ SQLRETURN SQL_API SQLSetConnectAttr (
1075
+ SQLHDBC ConnectionHandle,
1076
+ SQLINTEGER Attribute,
1077
+ SQLPOINTER Value,
1078
+ SQLINTEGER StringLength);
1079
+ #endif /* ODBCVER >= 0x0300 */
1080
+
1081
+ SQLRETURN SQL_API SQLSetConnectOption (
1082
+ SQLHDBC ConnectionHandle,
1083
+ SQLUSMALLINT Option,
1084
+ SQLULEN Value);
1085
+
1086
+ SQLRETURN SQL_API SQLSetCursorName (
1087
+ SQLHSTMT StatementHandle,
1088
+ SQLCHAR * CursorName,
1089
+ SQLSMALLINT NameLength);
1090
+
1091
+ #if (ODBCVER >= 0x0300)
1092
+ SQLRETURN SQL_API SQLSetDescField (
1093
+ SQLHDESC DescriptorHandle,
1094
+ SQLSMALLINT RecNumber,
1095
+ SQLSMALLINT FieldIdentifier,
1096
+ SQLPOINTER Value,
1097
+ SQLINTEGER BufferLength);
1098
+
1099
+ SQLRETURN SQL_API SQLSetDescRec (
1100
+ SQLHDESC DescriptorHandle,
1101
+ SQLSMALLINT RecNumber,
1102
+ SQLSMALLINT Type,
1103
+ SQLSMALLINT SubType,
1104
+ SQLLEN Length,
1105
+ SQLSMALLINT Precision,
1106
+ SQLSMALLINT Scale,
1107
+ SQLPOINTER Data,
1108
+ SQLLEN * StringLength,
1109
+ SQLLEN * Indicator);
1110
+
1111
+ SQLRETURN SQL_API SQLSetEnvAttr (
1112
+ SQLHENV EnvironmentHandle,
1113
+ SQLINTEGER Attribute,
1114
+ SQLPOINTER Value,
1115
+ SQLINTEGER StringLength);
1116
+ #endif /* ODBCVER >= 0x0300 */
1117
+
1118
+
1119
+ #if (ODBCVER >= 0x0300)
1120
+ SQLRETURN SQL_API SQLSetStmtAttr (
1121
+ SQLHSTMT StatementHandle,
1122
+ SQLINTEGER Attribute,
1123
+ SQLPOINTER Value,
1124
+ SQLINTEGER StringLength);
1125
+ #endif
1126
+
1127
+ SQLRETURN SQL_API SQLSetStmtOption (
1128
+ SQLHSTMT StatementHandle,
1129
+ SQLUSMALLINT Option,
1130
+ SQLULEN Value);
1131
+
1132
+ SQLRETURN SQL_API SQLSpecialColumns (
1133
+ SQLHSTMT StatementHandle,
1134
+ SQLUSMALLINT IdentifierType,
1135
+ SQLCHAR * CatalogName,
1136
+ SQLSMALLINT NameLength1,
1137
+ SQLCHAR * SchemaName,
1138
+ SQLSMALLINT NameLength2,
1139
+ SQLCHAR * TableName,
1140
+ SQLSMALLINT NameLength3,
1141
+ SQLUSMALLINT Scope,
1142
+ SQLUSMALLINT Nullable);
1143
+
1144
+ SQLRETURN SQL_API SQLStatistics (
1145
+ SQLHSTMT StatementHandle,
1146
+ SQLCHAR * CatalogName,
1147
+ SQLSMALLINT NameLength1,
1148
+ SQLCHAR * SchemaName,
1149
+ SQLSMALLINT NameLength2,
1150
+ SQLCHAR * TableName,
1151
+ SQLSMALLINT NameLength3,
1152
+ SQLUSMALLINT Unique,
1153
+ SQLUSMALLINT Reserved);
1154
+
1155
+ SQLRETURN SQL_API SQLTables (
1156
+ SQLHSTMT StatementHandle,
1157
+ SQLCHAR * CatalogName,
1158
+ SQLSMALLINT NameLength1,
1159
+ SQLCHAR * SchemaName,
1160
+ SQLSMALLINT NameLength2,
1161
+ SQLCHAR * TableName,
1162
+ SQLSMALLINT NameLength3,
1163
+ SQLCHAR * TableType,
1164
+ SQLSMALLINT NameLength4);
1165
+
1166
+ SQLRETURN SQL_API SQLTransact (
1167
+ SQLHENV EnvironmentHandle,
1168
+ SQLHDBC ConnectionHandle,
1169
+ SQLUSMALLINT CompletionType);
1170
+
1171
+
1172
+ /*
1173
+ * Depreciated ODBC 1.0 function - Use SQLBindParameter
1174
+ */
1175
+ SQLRETURN SQL_API SQLSetParam (
1176
+ SQLHSTMT StatementHandle,
1177
+ SQLUSMALLINT ParameterNumber,
1178
+ SQLSMALLINT ValueType,
1179
+ SQLSMALLINT ParameterType,
1180
+ SQLULEN LengthPrecision,
1181
+ SQLSMALLINT ParameterScale,
1182
+ SQLPOINTER ParameterValue,
1183
+ SQLLEN * StrLen_or_Ind);
1184
+
1185
+ #ifdef __cplusplus
1186
+ }
1187
+ #endif
1188
+
1189
+ #endif /* _SQL_H */