3 // Permission is hereby granted, free of charge, to any person obtaining
4 // a copy of this software and associated documentation files (the
5 // "Software"), to deal in the Software without restriction, including
6 // without limitation the rights to use, copy, modify, merge, publish,
7 // distribute, sublicense, and/or sell copies of the Software, and to
8 // permit persons to whom the Software is furnished to do so, subject to
9 // the following conditions:
11 // The above copyright notice and this permission notice shall be
12 // included in all copies or substantial portions of the Software.
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 namespace IBM
.Data
.DB2
27 /// Summary description for DB2Constants.
29 internal sealed class DB2Constants
31 public const short SQL_HANDLE_ENV
= 1;
32 public const short SQL_HANDLE_DBC
= 2;
33 public const short SQL_HANDLE_STMT
= 3;
34 public const short SQL_HANDLE_DESC
= 4;
37 public const short SQL_SUCCESS
= 0;
38 public const short SQL_SUCCESS_WITH_INFO
= 1;
39 public const short SQL_NEED_DATA
= 99;
40 public const short SQL_NO_DATA
= 100;
41 public const short SQL_STILL_EXECUTING
= 2;
42 public const short SQL_ERROR
= -1;
43 public const short SQL_INVALID_HANDLE
= -2;
45 public const int SQL_NTS
= -3;
46 public const long SQL_NULL_HANDLE
= 0L;
47 public const short SQL_COMMIT
= 0;
48 public const short SQL_ROLLBACK
= 1;
49 public const short SQL_NO_DATA_FOUND
= 100;
51 /* SQLFreeStmt option values */
52 public const short SQL_CLOSE
= 0;
53 public const short SQL_DROP
= 1;
54 public const short SQL_UNBIND
= 2;
55 public const short SQL_RESET_PARAMS
= 3;
57 /* Isolation levels */
58 public const long SQL_TXN_READ_UNCOMMITTED
= 0x00000001L
;
59 public const long SQL_TXN_READ_COMMITTED
= 0x00000002L
;
60 public const long SQL_TXN_REPEATABLE_READ
= 0x00000004L
;
61 public const long SQL_TXN_SERIALIZABLE_READ
= 0x00000008L
;
62 public const long SQL_TXN_NOCOMMIT
= 0x00000020L
;
65 public const int SQL_ATTR_TXN_ISOLATION
= 108;
66 public const int SQL_ATTR_AUTOCOMMIT
= 102;
69 public const int SQL_ATTR_ANSI_APP
= 115;
70 public const int SQL_AA_TRUE
= 1; /* the application is an ANSI app */
71 public const int SQL_AA_FALSE
= 0; /* the application is a Unicode app */
73 public const int SQL_ATTR_CONNECTION_DEAD
= 1209; /* GetConnectAttr only */
74 public const int SQL_CD_TRUE
= 1; /* the connection is dead */
75 public const int SQL_CD_FALSE
= 0; /* the connection is not dead */
77 public const int SQL_ATTR_QUERY_TIMEOUT
= 0;
78 public const int SQL_ATTR_MAX_ROWS
= 1;
79 public const int SQL_ATTR_DEFERRED_PREPARE
= 1277;
81 /*Used for batch operations*/
82 public const int SQL_ATTR_PARAMSET_SIZE
= 22;
83 public const int SQL_ATTR_PARAM_STATUS_PTR
= 20;
84 public const int SQL_ATTR_PARAMS_PROCESSED_PTR
= 21;
85 public const int SQL_ATTR_PARAM_BIND_TYPE
= 18;
87 public const int SQL_IS_POINTER
= -4;
88 public const int SQL_IS_UINTEGER
= -5;
89 public const int SQL_IS_INTEGER
= -6;
90 public const int SQL_IS_USMALLINT
= -7;
91 public const int SQL_IS_SMALLINT
= -8;
95 public const long SQL_AUTOCOMMIT_OFF
= 0L;
96 public const long SQL_AUTOCOMMIT_ON
= 1L;
99 public const int SQL_UNKNOWN_TYPE
= 0;
100 public const int SQL_CHAR
= 1;
101 public const int SQL_NUMERIC
= 2;
102 public const int SQL_DECIMAL
= 3;
103 public const int SQL_INTEGER
= 4;
104 public const int SQL_SMALLINT
= 5;
105 public const int SQL_FLOAT
= 6;
106 public const int SQL_REAL
= 7;
107 public const int SQL_DOUBLE
= 8;
108 public const int SQL_DATETIME
= 9;
109 public const int SQL_VARCHAR
= 12;
110 public const int SQL_VARBINARY
= (-3);
111 public const int SQL_LONGVARBINARY
= (-4);
112 public const int SQL_BIGINT
= (-5);
113 public const int SQL_BIT
= (-7);
114 public const int SQL_WCHAR
= (-8);
115 public const int SQL_WVARCHAR
= (-9);
116 public const int SQL_WLONGVARCHAR
= (-10);
117 public const int SQL_GUID
= (-11);
118 public const int SQL_UTINYINT
= (-28);
120 public const int SQL_TYPE_DATE
= 91;
121 public const int SQL_TYPE_TIME
= 92;
122 public const int SQL_TYPE_TIMESTAMP
= 93;
123 public const int SQL_TYPE_BINARY
= -2;
124 public const int SQL_GRAPHIC
= -95;
125 public const int SQL_VARGRAPHIC
= -96;
126 public const int SQL_LONGVARGRAPHIC
= -97;
127 public const int SQL_TYPE_BLOB
= -98;
128 public const int SQL_TYPE_CLOB
= -99;
129 public const int SQL_DBCLOB
= 350;
131 public const int SQL_C_CHAR
= SQL_CHAR
;
132 public const int SQL_C_WCHAR
= SQL_WCHAR
;
133 public const int SQL_C_SBIGINT
= -25;
134 public const int SQL_C_SLONG
= -16;
135 public const int SQL_C_SSHORT
= -15;
136 public const int SQL_C_TYPE_BINARY
= -2;
137 public const int SQL_C_DOUBLE
= 8;
138 public const int SQL_C_DECIMAL_IBM
= 3;
139 public const int SQL_C_DECIMAL_OLEDB
= 2514;
140 public const int SQL_C_DEFAULT
= 99;
141 public const int SQL_C_TYPE_DATE
= 91;
142 public const int SQL_C_TYPE_TIME
= 92;
143 public const int SQL_C_TYPE_TIMESTAMP
= 93;
144 public const int SQL_C_TYPE_NUMERIC
= 2;
145 public const int SQL_C_TYPE_REAL
= 7;
147 public const int SQL_BLOB_LOCATOR
= 31;
148 public const int SQL_CLOB_LOCATOR
= 41;
149 public const int SQL_DBCLOB_LOCATOR
= -351;
151 public const int SQL_C_BLOB_LOCATOR
= SQL_BLOB_LOCATOR
;
152 public const int SQL_C_CLOB_LOCATOR
= SQL_CLOB_LOCATOR
;
153 public const int SQL_C_DBCLOB_LOCATOR
= SQL_DBCLOB_LOCATOR
;
155 public const int SQL_USER_DEFINED_TYPE
= (-450);
157 /* Special length values */
158 public const int SQL_NULL_DATA
= -1;
160 /* SQLDriverConnect Options */
161 public const int SQL_DRIVER_NOPROMPT
= 0;
162 public const int SQL_DRIVER_COMPLETE
= 1;
163 public const int SQL_DRIVER_PROMPT
= 2;
164 public const int SQL_DRIVER_COMPLETE_REQUIRED
= 3;
167 public const int SQL_NO_NULLS
= 0;
168 public const int SQL_NULLABLE
= 1;
169 public const int SQL_NULLABLE_UNKNOWN
= 2;
171 public const int SQL_PARAM_BIND_BY_COLUMN
= 0;
173 /* Defines for SQLBindParameter and SQLProcedureColumns */
174 public const int SQL_PARAM_TYPE_UNKNOWN
= 0;
175 public const int SQL_PARAM_INPUT
= 1;
176 public const int SQL_PARAM_INPUT_OUTPUT
= 2;
177 public const int SQL_RESULT_COL
= 3;
178 public const int SQL_PARAM_OUTPUT
= 4;
179 public const int SQL_RETURN_VALUE
= 5;
181 /*Defines for SQLColAttributeW*/
182 public const int SQL_DESC_ALLOC_TYPE
= 1099;
183 public const int SQL_DESC_AUTO_UNIQUE_VALUE
= 11;
184 public const int SQL_DESC_BASE_COLUMN_NAME
= 22;
185 public const int SQL_DESC_BASE_TABLE_NAME
= 23;
186 public const int SQL_DESC_COLUMN_CATALOG_NAME
= 17;
187 public const int SQL_DESC_COLUMN_NAME
= 1;
188 public const int SQL_DESC_SCHEMA_NAME
= 16;
189 public const int SQL_DESC_COLUMN_TABLE_NAME
= 15;
190 public const int SQL_DESC_CONCISE_TYPE
= 2;
191 public const int SQL_DESC_COUNT
= 1001;
192 public const int SQL_DESC_DATA_PTR
= 1010;
193 public const int SQL_DESC_DATETIME_INTERVAL_CODE
= 1007;
194 public const int SQL_DESC_INDICATOR_PTR
= 1009;
195 public const int SQL_DESC_LENGTH
= 1003;
196 public const int SQL_DESC_NAME
= 1011;
197 public const int SQL_DESC_NULLABLE
= 1008;
198 public const int SQL_DESC_OCTET_LENGTH
= 1013;
199 public const int SQL_DESC_OCTET_LENGTH_PTR
= 1004;
200 public const int SQL_DESC_PRECISION
= 1005;
201 public const int SQL_DESC_SCALE
= 1006;
202 public const int SQL_DESC_TYPE
= 1002;
203 public const int SQL_DESC_TYPE_NAME
= 14;
204 public const int SQL_DESC_UNNAMED
= 1012;
205 public const int SQL_DESC_UNSIGNED
= 8;
206 public const int SQL_DESC_UPDATABLE
= 10;