Technology - DB2 to Netezza data type conversions


When migrating data from DB2 to Netezza, it’s important to understand how data types are mapped between the two platforms. This will help ensure that data is transferred accurately and efficiently, without any loss of information. This technical article will explore how data types are mapped from DB2 to Netezza.

DB2 and Netezza Data Types DB2 and Netezza have several data types in common, but there are also some differences between the two platforms. DB2 supports various data types such as INTEGER, DECIMAL, CHAR, VARCHAR, and DATE, while Netezza supports a similar set of data types, such as INTEGER, DECIMAL, CHAR, VARCHAR, and DATE. However, there are some differences in how these data types are defined and used.

Mapping DB2 Data Types to Netezza Data Types When mapping DB2 data types to Netezza data types, it’s important to consider the following:

  1. Integer Data Types: DB2’s INTEGER data type maps directly to Netezza’s INTEGER data type. However, DB2’s BIGINT data type maps to Netezza’s BIGINT data type.
  2. Decimal Data Types: DB2’s DECIMAL data type maps directly to Netezza’s DECIMAL data type, but there are differences in how these data types are defined. DB2 supports a maximum precision of 31 digits, while Netezza supports a maximum precision of 38 digits.
  3. Character Data Types: DB2’s CHAR and VARCHAR data types map directly to Netezza’s CHAR and VARCHAR data types, respectively. However, there are differences in how these data types are defined. Netezza supports a maximum length of 64K for both CHAR and VARCHAR, while DB2 supports a maximum length of 32K for CHAR and 32,672 for VARCHAR.
  4. Date Data Types: Both DB2 and Netezza support the DATE data type, and there is no mapping required for this data type.

Mapping data types from DB2 to Netezza is an essential step in the data migration process. By understanding the differences between data types in both platforms and how they are mapped, you can ensure that your data is transferred accurately and efficiently. It’s important to test the data migration thoroughly to ensure that all data has been transferred correctly and that there are no data type conversion issues.

DB2 To Netezza Data Type Mapping Table

This is an extracted table I created from the IBM source a while back when investigating in what format to convert data fields into for IBM Infosphere DataStage.  I have had it floating around in my notes, but lately, I have found myself referencing it to help other team members, so it seems useful to include it here.   The notes column is just a few snippets of information, which I have found useful to reference when planning data field conversions.

Transformer data typeDB2 data typeNetezza data typeNotes
BIGINTBIGINTBIGINT 
BINARYCHARACTERNot supported 
BITSMALLINTBOOLEAN 
CHARCHARACTERCHAR 
DATEDATEDATE 
DECIMALDECIMALNUMERIC or DECIMAL 
DOUBLEDOUBLEDOUBLE PRECISION or FLOAT(15) 
FLOATDOUBLEFLOAT 
INTEGERINTEGERINTEGER 
LONGVARBINARYBLOBNot supported 
LONGVARCHARCLOBVARCHARThe maximum character string size is 64,000.
NUMERICDECIMALNUMERIC 
REALREALREAL or FLOAT(6) 
SMALLINTSMALLINTSMALLINT 
TIMETIMETIMEDB2 9.1 TIME data type does not support fractional digits or microseconds.
TIMESTAMPTIMESTAMPTIMESTAMPDB2 9.1 TIME data type does not support fractional digits or microseconds.
TINYINTSMALLINTBYTEINT 
VARBINARYVARCHARNot supported 
VARCHARVARCHARVARCHARThe maximum character string size is 64,000.
WCHARGRAPHICNot supported 
WLONGVARCHARLONG VARGRAPHICNot supported 
WVARCHARVARGRAPHICNot supported 

Related References

IBM / Documentation / InfoSphere Information Server / 11.7 / Datatypes

IBM / Documentation / PureData System for Analytics / 7.2.1 / Data types and aliases

IBM / Documentation / All products / Db2 / 11.5 / IBM PureData System for Analytics (Netezza) and Db2 data type compatibility