IBM.Data.DB2Types Namespace
The IBM.Data.DB2Types namespace provides classes and structures that represent Db2® data types for the .NET Framework Data Provider.
The following table shows mappings between DB2Type data types, Db2 data types, Informix® data types, Microsoft .NET Framework types, and DB2Types classes and structures.
Category | DB2Types Classes and Structures | DB2Type Data Type | Db2 Data Type | Informix Data Type | .NET Data Type |
---|---|---|---|---|---|
Numeric | DB2Int16 | SmallInt | SMALLINT | BOOLEAN, SMALLINT | Int16 |
DB2Int32 | Integer | INT | INTEGER, INT, SERIAL | Int32 | |
DB2Int64 | BigInt, BigSerial | BIGINT | BIGINT, BIGSERIAL, INT8, SERIAL8 | Int64 | |
DB2Real, DB2Real370 | Real | REAL | REAL, SMALLFLOAT | Single | |
DB2Double | Double | DOUBLE PRECISION | DECIMAL (≤31), DOUBLE PRECISION | Double | |
DB2Double | Float | FLOAT | DECIMAL (32), FLOAT | Double | |
DB2Decimal | Decimal | DECIMAL | MONEY | Decimal | |
DB2DecimalFloat | DecimalFloat | DECFLOAT(16|34)4 | Decimal | ||
DB2Decimal | Numeric | DECIMAL | DECIMAL (≤31), NUMERIC | Decimal | |
Date/Time | DB2Date | Date | DATE | DATETIME (date precision) | Datetime |
DB2Time | Time | TIME | DATETIME (time precision) | TimeSpan | |
DB2TimeStamp | Timestamp | TIMESTAMP | DATETIME (time and date precision) | DateTime | |
DB2TimeStampOffset | TimestampWithTimeZone | TIMESTAMP WITH TIME ZONE | N/A | DateTimeOffset | |
XML | DB2Xml | Xml2 | XML | Byte[] | |
Character data | DB2String | Char | CHAR | CHAR | String |
DB2String | VarChar | VARCHAR | VARCHAR | String | |
DB2String | LongVarChar1 | LONG VARCHAR | LVARCHAR | String | |
Binary data | DB2Binary | Binary | CHAR FOR BIT DATA | Byte[] | |
DB2Binary | Binary3 | BINARY | Byte[] | ||
DB2Binary | VarBinary3 | VARBINARY | Byte[] | ||
DB2Binary | LongVarBinary1 | LONG VARCHAR FOR BIT DATA | Byte[] | ||
Graphic data | DB2String | Graphic | GRAPHIC | String | |
DB2String | VarGraphic | VARGRAPHIC | String | ||
DB2String | LongVarGraphic1 | LONG VARGRAPHIC | String | ||
LOB data | DB2Clob | Clob | CLOB | CLOB, TEXT | String |
DB2Blob | Blob | BLOB | BLOB, BYTE | Byte[] | |
DB2Clob | DbClob | DBCLOB | String | ||
Row ID | DB2RowId | RowId | ROWID | Byte[] |
Enumerations
Enumeration | Description |
---|---|
![]() |
Specify the rounding mode to use with DB2DecimalFloat objects. |
1 These data types are not supported as parameters in
DB2® .NET common language runtime routines.
2 A DB2ParameterClass.ParameterName property of the type
DB2Type.Xml can
accept variables of the following types: String, byte[], DB2Xml, and XmlReader.
3 These data types are applicable only to Db2 for z/OS® Version 9 and
later releases and Db2 for IBM® i V6R1 and
later releases.
4 This data type is only supported for Db2 for z/OS Version 9 and
later releases and for Db2 Version 9.5 and
later releases.