2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / IBM.Data.DB2 / IBM.Data.DB2 / DB2Constants.cs
1
2 //
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:
10 // 
11 // The above copyright notice and this permission notice shall be
12 // included in all copies or substantial portions of the Software.
13 // 
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.
21 //
22 using System;\r
23 \r
24 namespace IBM.Data.DB2\r
25 {\r
26         /// <summary>\r
27         /// Summary description for DB2Constants.\r
28         /// </summary>\r
29         internal sealed class DB2Constants\r
30         {\r
31                 public const short  SQL_HANDLE_ENV = 1;\r
32                 public const short  SQL_HANDLE_DBC = 2;\r
33                 public const short  SQL_HANDLE_STMT = 3;\r
34                 public const short  SQL_HANDLE_DESC = 4;\r
35 \r
36                 /* RETCODE values             */\r
37                 public const short  SQL_SUCCESS                  = 0;\r
38                 public const short  SQL_SUCCESS_WITH_INFO = 1;\r
39                 public const short  SQL_NEED_DATA         = 99;\r
40                 public const short  SQL_NO_DATA           = 100;\r
41                 public const short  SQL_STILL_EXECUTING   = 2;\r
42                 public const short  SQL_ERROR             = -1;\r
43                 public const short  SQL_INVALID_HANDLE    = -2;\r
44 \r
45                 public const int   SQL_NTS                               = -3;\r
46                 public const long  SQL_NULL_HANDLE               = 0L;\r
47                 public const short SQL_COMMIT                    = 0;\r
48                 public const short SQL_ROLLBACK                  = 1;\r
49                 public const short SQL_NO_DATA_FOUND     = 100;\r
50 \r
51                 /* SQLFreeStmt option values  */\r
52                 public const short SQL_CLOSE             = 0;\r
53                 public const short SQL_DROP              = 1;\r
54                 public const short SQL_UNBIND            = 2;\r
55                 public const short SQL_RESET_PARAMS      = 3;\r
56 \r
57                 /* Isolation levels */\r
58                 public const long  SQL_TXN_READ_UNCOMMITTED             = 0x00000001L;\r
59                 public const long  SQL_TXN_READ_COMMITTED               = 0x00000002L;\r
60                 public const long  SQL_TXN_REPEATABLE_READ              = 0x00000004L;\r
61                 public const long  SQL_TXN_SERIALIZABLE_READ    = 0x00000008L;\r
62                 public const long  SQL_TXN_NOCOMMIT                             = 0x00000020L;\r
63 \r
64                 /* Connect options */\r
65                 public const int  SQL_ATTR_TXN_ISOLATION= 108;\r
66                 public const int  SQL_ATTR_AUTOCOMMIT   = 102;\r
67 \r
68                 /* attribute */\r
69                 public const int  SQL_ATTR_ANSI_APP             = 115;\r
70                 public const int  SQL_AA_TRUE           = 1;      /* the application is an ANSI app */\r
71                 public const int  SQL_AA_FALSE          = 0;      /* the application is a Unicode app */\r
72 \r
73                 public const int  SQL_ATTR_CONNECTION_DEAD = 1209;    /* GetConnectAttr only */\r
74                 public const int  SQL_CD_TRUE           = 1;      /* the connection is dead */\r
75                 public const int  SQL_CD_FALSE          = 0;      /* the connection is not dead */\r
76 \r
77                 public const int  SQL_ATTR_QUERY_TIMEOUT = 0;\r
78                 public const int  SQL_ATTR_MAX_ROWS             = 1;\r
79                 public const int  SQL_ATTR_DEFERRED_PREPARE = 1277;\r
80 \r
81                 /*Used for batch operations*/\r
82                 public const int  SQL_ATTR_PARAMSET_SIZE = 22;\r
83                 public const int  SQL_ATTR_PARAM_STATUS_PTR = 20;\r
84                 public const int  SQL_ATTR_PARAMS_PROCESSED_PTR = 21;\r
85                 public const int SQL_ATTR_PARAM_BIND_TYPE           = 18;\r
86 \r
87                 public const int  SQL_IS_POINTER        = -4;\r
88                 public const int  SQL_IS_UINTEGER       = -5;\r
89                 public const int  SQL_IS_INTEGER        = -6;\r
90                 public const int  SQL_IS_USMALLINT      = -7;\r
91                 public const int  SQL_IS_SMALLINT       = -8;\r
92 \r
93 \r
94 \r
95                 public const long SQL_AUTOCOMMIT_OFF    = 0L;\r
96                 public const long SQL_AUTOCOMMIT_ON             = 1L;\r
97 \r
98                 /* Data Types */\r
99                 public const int  SQL_UNKNOWN_TYPE              = 0;\r
100                 public const int  SQL_CHAR                              = 1;\r
101                 public const int  SQL_NUMERIC                   = 2;\r
102                 public const int  SQL_DECIMAL                   = 3;\r
103                 public const int  SQL_INTEGER                   = 4;\r
104                 public const int  SQL_SMALLINT                  = 5;\r
105                 public const int  SQL_FLOAT                             = 6;\r
106                 public const int  SQL_REAL                              = 7;\r
107                 public const int  SQL_DOUBLE                    = 8;\r
108                 public const int  SQL_DATETIME                  = 9;\r
109                 public const int  SQL_VARCHAR                   = 12;\r
110                 public const int  SQL_VARBINARY         = (-3);\r
111                 public const int  SQL_LONGVARBINARY     = (-4);\r
112                 public const int  SQL_BIGINT                    = (-5);\r
113                 public const int  SQL_BIT                               = (-7);\r
114                 public const int  SQL_WCHAR                             = (-8);\r
115                 public const int  SQL_WVARCHAR                  = (-9);\r
116                 public const int  SQL_WLONGVARCHAR              = (-10);\r
117                 public const int  SQL_GUID                              = (-11);\r
118                 public const int  SQL_UTINYINT              = (-28);\r
119 \r
120                 public const int  SQL_TYPE_DATE                 = 91;\r
121                 public const int  SQL_TYPE_TIME                 = 92;\r
122                 public const int  SQL_TYPE_TIMESTAMP    = 93;\r
123                 public const int SQL_TYPE_BINARY                = -2;\r
124                 public const int SQL_GRAPHIC            = -95;\r
125                 public const int SQL_VARGRAPHIC         = -96;\r
126                 public const int SQL_LONGVARGRAPHIC     = -97;\r
127                 public const int SQL_TYPE_BLOB                  = -98;\r
128                 public const int SQL_TYPE_CLOB                  = -99;\r
129                 public const int SQL_DBCLOB                             = 350;\r
130 \r
131                 public const int  SQL_C_CHAR                    = SQL_CHAR;\r
132                 public const int  SQL_C_WCHAR                   = SQL_WCHAR;\r
133                 public const int SQL_C_SBIGINT          = -25;\r
134                 public const int SQL_C_SLONG                    = -16;\r
135                 public const int SQL_C_SSHORT                   = -15;\r
136                 public const int SQL_C_TYPE_BINARY              = -2;\r
137                 public const int SQL_C_DOUBLE                   = 8;\r
138                 public const int SQL_C_DECIMAL_IBM              = 3;\r
139                 public const int SQL_C_DECIMAL_OLEDB            = 2514;\r
140                 public const int  SQL_C_DEFAULT                 = 99;\r
141                 public const int SQL_C_TYPE_DATE                = 91;\r
142                 public const int SQL_C_TYPE_TIME                = 92;\r
143                 public const int SQL_C_TYPE_TIMESTAMP           = 93;\r
144                 public const int SQL_C_TYPE_NUMERIC             = 2;\r
145                 public const int SQL_C_TYPE_REAL                = 7;\r
146 \r
147                 public const int  SQL_BLOB_LOCATOR              = 31;\r
148                 public const int  SQL_CLOB_LOCATOR              = 41;\r
149                 public const int  SQL_DBCLOB_LOCATOR    = -351;\r
150 \r
151                 public const int  SQL_C_BLOB_LOCATOR = SQL_BLOB_LOCATOR;\r
152                 public const int  SQL_C_CLOB_LOCATOR = SQL_CLOB_LOCATOR;\r
153                 public const int  SQL_C_DBCLOB_LOCATOR = SQL_DBCLOB_LOCATOR;\r
154 \r
155                 public const int  SQL_USER_DEFINED_TYPE = (-450);\r
156 \r
157                 /* Special length values  */\r
158                 public const int SQL_NULL_DATA                  = -1;\r
159 \r
160                 /* SQLDriverConnect Options */\r
161                 public const int  SQL_DRIVER_NOPROMPT   = 0;\r
162                 public const int  SQL_DRIVER_COMPLETE   = 1;\r
163                 public const int  SQL_DRIVER_PROMPT     = 2;\r
164                 public const int  SQL_DRIVER_COMPLETE_REQUIRED = 3;\r
165 \r
166                 /* Null settings */\r
167                 public const int  SQL_NO_NULLS                  = 0;\r
168                 public const int  SQL_NULLABLE                  = 1;\r
169                 public const int  SQL_NULLABLE_UNKNOWN  = 2;\r
170 \r
171                 public const int SQL_PARAM_BIND_BY_COLUMN    = 0;\r
172 \r
173                 /* Defines for SQLBindParameter and SQLProcedureColumns */\r
174                 public const int SQL_PARAM_TYPE_UNKNOWN = 0;\r
175                 public const int SQL_PARAM_INPUT                = 1;\r
176                 public const int SQL_PARAM_INPUT_OUTPUT = 2;\r
177                 public const int SQL_RESULT_COL         = 3;\r
178                 public const int SQL_PARAM_OUTPUT       = 4;\r
179                 public const int SQL_RETURN_VALUE       = 5;\r
180                 \r
181                 /*Defines for SQLColAttributeW*/\r
182                 public const int SQL_DESC_ALLOC_TYPE = 1099;\r
183                 public const int SQL_DESC_AUTO_UNIQUE_VALUE = 11;\r
184                 public const int SQL_DESC_BASE_COLUMN_NAME = 22;\r
185                 public const int SQL_DESC_BASE_TABLE_NAME = 23;\r
186                 public const int SQL_DESC_COLUMN_CATALOG_NAME = 17;\r
187                 public const int SQL_DESC_COLUMN_NAME = 1;\r
188                 public const int SQL_DESC_SCHEMA_NAME = 16;\r
189                 public const int SQL_DESC_COLUMN_TABLE_NAME = 15;\r
190                 public const int SQL_DESC_CONCISE_TYPE = 2;\r
191                 public const int SQL_DESC_COUNT = 1001;\r
192                 public const int SQL_DESC_DATA_PTR = 1010;\r
193                 public const int SQL_DESC_DATETIME_INTERVAL_CODE = 1007;\r
194                 public const int SQL_DESC_INDICATOR_PTR = 1009;\r
195                 public const int SQL_DESC_LENGTH = 1003;\r
196                 public const int SQL_DESC_NAME = 1011;\r
197                 public const int SQL_DESC_NULLABLE = 1008;\r
198                 public const int SQL_DESC_OCTET_LENGTH = 1013;\r
199                 public const int SQL_DESC_OCTET_LENGTH_PTR = 1004;\r
200                 public const int SQL_DESC_PRECISION = 1005;\r
201                 public const int SQL_DESC_SCALE = 1006;\r
202                 public const int SQL_DESC_TYPE = 1002;\r
203                 public const int SQL_DESC_TYPE_NAME = 14;\r
204                 public const int SQL_DESC_UNNAMED = 1012;\r
205                 public const int SQL_DESC_UNSIGNED = 8;\r
206                 public const int SQL_DESC_UPDATABLE = 10; \r
207         }\r
208 }\r