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