DB2Type enumeration
Specifies the data type of a field, property, or DB2Parameter.
- Namespace:
IBM.Data.
DB2
- Assembly:
IBM.Data.
(inDB2
IBM.Data.
)DB2
.dll
Syntax
[Visual Basic]
<Serializable>
Public Enum DB2
Type
[C#]
[Serializable]
public enum DB2
Type
[C++]
[Serializable]
__value public enum DB2
Type
[JScript]
public
Serializable
enum DB2
Type
Members
The following table lists members
of DB2
Type
enumeration.
Member | Description |
---|---|
BigInt | A 64-bit integer. Represents the BIGINT, BIGSERIAL, INT8, SERIAL8 Informix data types, and the BIGINT DB2 data type. |
BigSerial | A 64-bit integer. Represents the BIGINT, BIGSERIAL, INT8, SERIAL8 Informix data types. |
Binary | An array of bytes. Represents the CHAR, VARCHAR, LONG VARCHAR, GRAPHIC, VARGRAPHIC, and LONG VARGRAPHIC DB2 data types. |
Blob | An array of bytes. Represents the BLOB DB2 data type. |
Byte | An array of bytes. Represents the BLOB DB2 data type. |
Char | A single character. Represents the CHAR DB2 data type. |
Clob | A large string of characters. Represents the CLOB DB2 data type. |
Date | A string that represents a date. Represents the DATE DB2 data type. |
DateTime | A string that represents a date. Represents the DATE DB2 data type. |
DbClob | A large string of characters. Represents the DbCLOB DB2 data type. |
Decimal | A decimal value. Represents the DECIMAL DB2 data type. |
DecimalFloat | A floating decimal value. Represents the DECIMALFLOAT DB2 data type. |
Double | A double-precision floating-point value. Represents the DOUBLE PRECISION DB2 data type. |
Float | A single-precision floating-point value. Represents the FLOAT DB2 data type. |
Graphic | A string of characters. Represents the GRAPHIC DB2 data type. |
Integer | A 32-bit integer. Represents the INT DB2 data type. |
Int8 | A 64-bit integer. Represents the BIGINT, BIGSERIAL, INT8, SERIAL8 Informix data types, and the BIGINT DB2 data type. |
LongVarBinary | An array of bytes. Represents the LONG VARCHAR FOR BIT DATA DB2 data type. |
LongVarGraphic | A string of characters. Represents the LONG VARGRAPHIC DB2 data type. |
Money | A decimal value. Represents the DECIMAL DB2 data type. |
Numeric | A decimal value. Represents the DECIMAL DB2 data type. |
Real | A floating-point number. Represents the REAL DB2 data type. |
Real370 | A floating-point number. Represents the REAL DB2 data type. |
RowId | An array of bytes that represent the identifier of a row. Represents the ROWID DB2 data type. |
Serial | A 32-bit integer. Represents the INT DB2 data type. |
Serial8 | A 64-bit integer. Represents the BIGINT, BIGSERIAL, INT8, SERIAL8 Informix data types, and the BIGINT DB2 data type. |
SmallInt | A 16-bit integer. Represents the SMALLINT DB2 data type. |
Text | A large string of characters. Represents the CLOB DB2 data type. |
Time | A string that represents the time of day. Represents the TIME DB2 data type. |
Timestamp | A string that represents a timestamp. Represents the TIMESTAMP DB2 data type. |
VarBinary | An array of bytes. Represents the VARBINARY DB2 data type. |
VarChar | A string of characters. Represents the VARCHAR DB2 data type. |
VarGraphic | A string of characters. Represents the VARGRAPHIC DB2 data type. |
Xml | An XML document. Represents the XML DB2 data type. |
Remarks
The following table shows mappings between DB2Type data types, Informix® data types, Db2® data types, Microsoft .NET Framework types, and DB2Types classes and structures.
Category | DB2Type Data Type | Db2Data Type | Informix Data Type | .NET Framework Data Type | DB2Types Namespace Classes and Structures |
---|---|---|---|---|---|
Binary data | Binary | CHAR FOR BIT DATA | Byte[] | DB2Binary | |
Binary3 | BINARY | Byte[] | DB2Binary | ||
VarBinary3 | VARBINARY | Byte[] | DB2Binary | ||
LongVarBinary1 | LONG VARCHAR FOR BIT DATA | Byte[] | DB2Binary | ||
Character data | Char | CHAR | CHAR | String | DB2String |
VarChar | VARCHAR | VARCHAR | String | DB2String | |
LongVarChar1 | LONG VARCHAR | LVARCHAR | String | DB2String | |
Date/Time data | Date | DATE | DATETIME (date precision) |
DateTime String5 |
DB2Date |
Time | TIME | DATETIME (time precision) |
TimeSpan String5 |
DB2Time | |
Timestamp | TIMESTAMP | DATETIME (date and time precision) |
DateTime String5 |
DB2TimeStamp | |
Graphic data | Graphic | GRAPHIC | String | DB2String | |
VarGraphic | VARGRAPHIC | String | DB2String | ||
LongVarGraphic1 | LONG VARGRAPHIC | String | DB2String | ||
LOB data | Clob | CLOB | CLOB, TEXT | String | DB2Clob |
Blob | BLOB | BLOB, BYTE | Byte[] | DB2Blob | |
DbClob | DBCLOB | String | DB2Clob | ||
Numeric data | SmallInt | SMALLINT | BOOLEAN, SMALLINT | Int16 | DB2Int16 |
Integer | INT | INT, INTEGER, SERIAL | Int32 | DB2Int32 | |
BigInt, BigSerial | BIGINT | BIGINT, BIGSERIAL, INT8, SERIAL8 | Int64 | DB2Int64 | |
Real | REAL | REAL, SMALLFLOAT | Single | DB2Real, DB2Real370 | |
Double | DOUBLE PRECISION | DECIMAL (≤ 29), DOUBLE PRECISION | Double | DB2Double | |
Float | FLOAT | DECIMAL (32), FLOAT | Double | DB2Double | |
Decimal | DECIMAL | MONEY | Decimal | DB2Decimal | |
DecimalFloat | DECFLOAT(16|34)3 | Decimal | DB2DecimalFloat | ||
Numeric | DECIMAL | DECIMAL (≤ 29), NUMERIC | Decimal | DB2Decimal | |
Row ID data | RowId | ROWID | Byte[] | DB2RowId | |
XML data | Xml2 | XML | Byte[] | DB2Xml | |
Cursor | Cursor2 | CURSOR |
Note: The DB2Type enumeration member Cursor can be used when you are binding an output
parameter of the type cursor.
- Limitation
- The ParameterCollection.Value property always returns a DataReader object, regardless of the type of cursor that is opened in the stored procedure.
Informix data types are
added to the DB2Type enumeration for use with Informix database
server. Some of the
Informix data
types that are added to the
DB2Type
enumeration is provided to allow for a clean
compilation of an application and throws an exception if you use these DB2Type
data
types at run time.
DB2Type data type | Throws an exception at run time |
---|---|
Serial | No |
Int8 | No |
Serial8 | No |
Money | No |
DateTime | No |
Text | No |
Byte | No |
Char1 | Yes |
SmallFloat | Yes |
Null | Yes |
IntervalYearMonth | Yes |
IntervalDayFraction | Yes |
NChar | Yes |
NVarChar | Yes |
Set | Yes |
MutiSet | Yes |
List | Yes |
Row | Yes |
SQLUDTVar | Yes |
SQLUDTFixed | Yes |
SmartLobLocator | Yes |
Boolean | Yes |
Other | Yes |
1 These data types are not
supported 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®.
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.
5 Date and Time objects can be timestamp string
literals. Timestamp objects can be date string literals. For information about timestamp string
literal usage, seeDB2Parameter Class.
6 The DB2Type
enumeration member Cursor can be used when you are binding an output parameter of the type
cursor.