Skip to main content
A newer version of this page is available. .

DB2 Data Types Mapping

XPO creates these column types when updating the DB2 database schema and expects them in existing databases.

.NET Type Database Column Type
Boolean char(1)
Byte smallint
SByte numeric(3,0)
Char graphic(1)
Decimal decimal(28,4)
Double double precision
Single real
Int16 smallint
UInt16 numeric(5,0)
Int32 int
UInt32 numeric(10,0)
Int64 bigint
UInt64 numeric(20,0)
Guid char(36)
String vargraphic(N)
DateTime timestamp
TimeSpan double precision
Byte[] blob
Unlimited size string dbclob

Mapping Properties To Database Column Types Not Supported By Default

If a column type is not listed in the above table but can be converted to any of the listed type by the database, it can be read and modified by XPO. To create a column of a specific type in the database when updating the schema, decorate the property with DbTypeAttribute. If a column type cannot be converted to a supported type, it is possible to support such columns by creating a custom connection provider. Here are some examples:

See Also