~ubuntu-branches/ubuntu/gutsy/psqlodbc/gutsy

« back to all changes in this revision

Viewing changes to isql.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2007-03-05 22:28:19 UTC
  • mfrom: (3.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20070305222819-95d0rzmt2ah6dwwc
Tags: 1:08.01.0200-2.1
* Non-maintainer upload.
* High-urgency upload for RC bugfix.
* Fix the signature of SQLGetData on 64-bit architectures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Modified isql.h file from iodbc. This file should be placed in the
3
 
 * include path to be used to create ODBC compliant applications.
4
 
 */
5
 
 
6
 
#ifndef _INTRINSIC_SQL_H
7
 
#define _INTRINSIC_SQL_H
8
 
 
9
 
typedef unsigned char UCHAR;
10
 
typedef long int SDWORD;
11
 
typedef short int SWORD;
12
 
typedef unsigned long int UDWORD;
13
 
typedef unsigned short int UWORD;
14
 
 
15
 
typedef void FAR *PTR;
16
 
 
17
 
typedef void FAR *HENV;
18
 
typedef void FAR *HDBC;
19
 
typedef void FAR *HSTMT;
20
 
 
21
 
typedef signed short RETCODE;
22
 
 
23
 
#ifdef WIN32
24
 
#define SQL_API                  __stdcall
25
 
#else
26
 
#define SQL_API                  EXPORT CALLBACK
27
 
#endif
28
 
 
29
 
/*#define ODBCVER               0x0250 */
30
 
 
31
 
#define SQL_MAX_MESSAGE_LENGTH                  512
32
 
#define SQL_MAX_DSN_LENGTH                              32
33
 
 
34
 
/* return code */
35
 
#define SQL_INVALID_HANDLE                              (-2)
36
 
#define SQL_ERROR                                               (-1)
37
 
#define SQL_SUCCESS                                             0
38
 
#define SQL_SUCCESS_WITH_INFO                   1
39
 
#define SQL_NO_DATA_FOUND                               100
40
 
 
41
 
/* standard SQL datatypes (agree with ANSI type numbering) */
42
 
#define SQL_CHAR                                                1
43
 
#define SQL_NUMERIC                                             2
44
 
#define SQL_DECIMAL                                             3
45
 
#define SQL_INTEGER                                             4
46
 
#define SQL_SMALLINT                                    5
47
 
#define SQL_FLOAT                                               6
48
 
#define SQL_REAL                                                7
49
 
#define SQL_DOUBLE                                              8
50
 
#define SQL_VARCHAR                                             12
51
 
 
52
 
#define SQL_TYPE_MIN                                    SQL_CHAR
53
 
#define SQL_TYPE_NULL                                   0
54
 
#define SQL_TYPE_MAX                                    SQL_VARCHAR
55
 
 
56
 
/* C to SQL datatype mapping */
57
 
#define SQL_C_CHAR                                              SQL_CHAR
58
 
#define SQL_C_LONG                                              SQL_INTEGER
59
 
#define SQL_C_SHORT                                             SQL_SMALLINT
60
 
#define SQL_C_FLOAT                                             SQL_REAL
61
 
#define SQL_C_DOUBLE                                    SQL_DOUBLE
62
 
#define SQL_C_DEFAULT                                   99
63
 
 
64
 
#define SQL_NO_NULLS                                    0
65
 
#define SQL_NULLABLE                                    1
66
 
#define SQL_NULLABLE_UNKNOWN                    2
67
 
 
68
 
/* some special length values */
69
 
#define SQL_NULL_DATA                                   (-1)
70
 
#define SQL_DATA_AT_EXEC                                (-2)
71
 
#define SQL_NTS                                                 (-3)
72
 
 
73
 
/* SQLFreeStmt flag values */
74
 
#define SQL_CLOSE                                               0
75
 
#define SQL_DROP                                                1
76
 
#define SQL_UNBIND                                              2
77
 
#define SQL_RESET_PARAMS                                3
78
 
 
79
 
/* SQLTransact flag values */
80
 
#define SQL_COMMIT                                              0
81
 
#define SQL_ROLLBACK                                    1
82
 
 
83
 
/* SQLColAttributes flag values */
84
 
#define SQL_COLUMN_COUNT                                0
85
 
#define SQL_COLUMN_LABEL                                18
86
 
#define SQL_COLATT_OPT_MAX                              SQL_COLUMN_LABEL
87
 
#define SQL_COLUMN_DRIVER_START                 1000
88
 
 
89
 
#define SQL_COLATT_OPT_MIN                              SQL_COLUMN_COUNT
90
 
 
91
 
/* Null handles */
92
 
#define SQL_NULL_HENV                                   0
93
 
#define SQL_NULL_HDBC                                   0
94
 
#define SQL_NULL_HSTMT                                  0
95
 
 
96
 
/* All code below has been added to the original isql.h coming from iodbc */
97
 
typedef unsigned char BYTE;
98
 
 
99
 
/* More SQLColAttributes flag values */
100
 
#define SQL_COLUMN_NAME                                 1
101
 
#define SQL_COLUMN_TYPE                                 2
102
 
#define SQL_COLUMN_LENGTH                               3
103
 
#define SQL_COLUMN_PRECISION                    4
104
 
#define SQL_COLUMN_SCALE                                5
105
 
#define SQL_COLUMN_DISPLAY_SIZE                 6
106
 
#define SQL_COLUMN_NULLABLE                             7
107
 
#define SQL_COLUMN_UNSIGNED                             8
108
 
#define SQL_COLUMN_MONEY                                9
109
 
#define SQL_COLUMN_UPDATABLE                    10
110
 
#define SQL_COLUMN_AUTO_INCREMENT               11
111
 
#define SQL_COLUMN_CASE_SENSITIVE               12
112
 
#define SQL_COLUMN_SEARCHABLE                   13
113
 
#define SQL_COLUMN_TYPE_NAME                    14
114
 
#define SQL_COLUMN_TABLE_NAME                   15
115
 
#define SQL_COLUMN_OWNER_NAME                   16
116
 
#define SQL_COLUMN_QUALIFIER_NAME               17
117
 
 
118
 
/* SQLColAttributes Searchable flags */
119
 
#define SQL_UNSEARCHABLE                                0
120
 
#define SQL_LIKE_ONLY                                   1
121
 
#define SQL_ALL_EXCEPT_LIKE                             2
122
 
#define SQL_SEARCHABLE                                  3
123
 
#define SQL_PRED_SEARCHABLE                             SQL_SEARCHABLE
124
 
 
125
 
/* SQLColAttributes Updateable flags */
126
 
#define SQL_ATTR_READONLY                               0
127
 
#define SQL_ATTR_WRITE                                  1
128
 
#define SQL_ATTR_READWRITE_UNKNOWN              2
129
 
 
130
 
/*
131
 
 *      function prototypes previously not contained in isql.h
132
 
 */
133
 
#ifdef __cplusplus
134
 
extern          "C"
135
 
{
136
 
#endif
137
 
 
138
 
RETCODE SQL_API SQLAllocConnect(HENV henv,
139
 
                                HDBC FAR * phdbc);
140
 
RETCODE SQL_API SQLAllocEnv(HENV FAR * phenv);
141
 
RETCODE SQL_API SQLAllocStmt(HDBC hdbc,
142
 
                         HSTMT FAR * phstmt);
143
 
RETCODE SQL_API SQLBindCol(HSTMT hstmt,
144
 
                   UWORD icol,
145
 
                   SWORD fCType,
146
 
                   PTR rgbValue,
147
 
                   SDWORD cbValueMax,
148
 
                   SDWORD FAR * pcbValue);
149
 
 
150
 
RETCODE SQL_API SQLCancel(HSTMT hstmt);
151
 
 
152
 
RETCODE SQL_API SQLColAttributes(HSTMT hstmt,
153
 
                                 UWORD icol,
154
 
                                 UWORD fDescType,
155
 
                                 PTR rgbDesc,
156
 
                                 SWORD cbDescMax,
157
 
                                 SWORD FAR * pcbDesc,
158
 
                                 SDWORD FAR * pfDesc);
159
 
 
160
 
RETCODE SQL_API SQLConnect(HDBC hdbc,
161
 
                   UCHAR FAR * szDSN,
162
 
                   SWORD cbDSN,
163
 
                   UCHAR FAR * szUID,
164
 
                   SWORD cbUID,
165
 
                   UCHAR FAR * szAuthStr,
166
 
                   SWORD cbAuthStr);
167
 
 
168
 
RETCODE SQL_API SQLDescribeCol(HSTMT hstmt,
169
 
                           UWORD icol,
170
 
                           UCHAR FAR * szColName,
171
 
                           SWORD cbColNameMax,
172
 
                           SWORD FAR * pcbColName,
173
 
                           SWORD FAR * pfSqlType,
174
 
                           UDWORD FAR * pcbColDef,
175
 
                           SWORD FAR * pibScale,
176
 
                           SWORD FAR * pfNullable);
177
 
 
178
 
RETCODE SQL_API SQLDisconnect(HDBC hdbc);
179
 
 
180
 
RETCODE SQL_API SQLError(HENV henv,
181
 
                 HDBC hdbc,
182
 
                 HSTMT hstmt,
183
 
                 UCHAR FAR * szSqlState,
184
 
                 SDWORD FAR * pfNativeError,
185
 
                 UCHAR FAR * szErrorMsg,
186
 
                 SWORD cbErrorMsgMax,
187
 
                 SWORD FAR * pcbErrorMsg);
188
 
 
189
 
RETCODE SQL_API SQLExecDirect(HSTMT hstmt,
190
 
                          UCHAR FAR * szSqlStr,
191
 
                          SDWORD cbSqlStr);
192
 
 
193
 
RETCODE SQL_API SQLExecute(HSTMT hstmt);
194
 
 
195
 
RETCODE SQL_API SQLFetch(HSTMT hstmt);
196
 
 
197
 
RETCODE SQL_API SQLFreeConnect(HDBC hdbc);
198
 
 
199
 
RETCODE SQL_API SQLFreeEnv(HENV henv);
200
 
 
201
 
RETCODE SQL_API SQLFreeStmt(HSTMT hstmt,
202
 
                        UWORD fOption);
203
 
 
204
 
RETCODE SQL_API SQLGetCursorName(HSTMT hstmt,
205
 
                                 UCHAR FAR * szCursor,
206
 
                                 SWORD cbCursorMax,
207
 
                                 SWORD FAR * pcbCursor);
208
 
 
209
 
RETCODE SQL_API SQLNumResultCols(HSTMT hstmt,
210
 
                                 SWORD FAR * pccol);
211
 
 
212
 
RETCODE SQL_API SQLPrepare(HSTMT hstmt,
213
 
                   UCHAR FAR * szSqlStr,
214
 
                   SDWORD cbSqlStr);
215
 
 
216
 
RETCODE SQL_API SQLRowCount(HSTMT hstmt,
217
 
                        SDWORD FAR * pcrow);
218
 
 
219
 
RETCODE SQL_API SQLSetCursorName(HSTMT hstmt,
220
 
                                 UCHAR FAR * szCursor,
221
 
                                 SWORD cbCursor);
222
 
 
223
 
RETCODE SQL_API SQLTransact(HENV henv,
224
 
                        HDBC hdbc,
225
 
                        UWORD fType);
226
 
 
227
 
RETCODE SQL_API SQLSetParam(HSTMT hstmt,
228
 
                        UWORD ipar,
229
 
                        SWORD fCType,
230
 
                        SWORD fSqlType,
231
 
                        UDWORD cbColDef,
232
 
                        SWORD ibScale,
233
 
                        PTR rgbValue,
234
 
                        SDWORD FAR * pcbValue);
235
 
 
236
 
RETCODE SQL_API SQLDataSources(HENV henv,
237
 
                           UWORD Direction, UCHAR FAR * ServerName,
238
 
                           WORD BufferLength1, WORD *NameLength1,
239
 
                           UCHAR FAR * Description, WORD BufferLength2,
240
 
                           WORD *NameLength2);
241
 
 
242
 
#ifdef __cplusplus
243
 
}
244
 
#endif
245
 
 
246
 
#endif