Db2 Admin Tool data type conversions

Db2 Admin Tool supports conversions between certain data types, such as integer and decimal.

The following tables show the supported conversions. In the first table, X indicates that Db2 Admin Tool supports the data type conversion.

Table 1. Db2 Admin Tool data type conversions, part 1
New data type:
Original data type: sm. int. int. float dec. char. vchar. long vchar. graph var. graph. long vgr. date time time st.
small integer X X X X1 X X              
integer X1 X X X1 X X              
float X X X X                  
decimal X1 X1 X X1 X X         X X X
character X X   X X1 X1 X       X2 X3 X4
varchar X X   X X1 X1 X       X2 X3 X4
long varchar         X1 X1 X       X2 X3 X4
graphic               X X X      
vgraphic               X X X      
long vgraphic               X X X      
date         X X         X   X
time         X X           X  
time stamp         X X         X X X
Notes:
  1. This conversion checks for truncation and number overflows. It is displayed during the ALT process and before job submission.
  2. For this conversion to date format, the following load formats are valid:
    • dd.mm.yyyy
    • mm/dd/yyyy
    • yyyy-mm-dd
  3. For this conversion to time format, the following load formats are valid:
    • hh.mm.ss
    • hh:mm AM
    • hh:mm PM
    • hh:mm:ss
  4. For this conversion to time stamp format, the following load formats are valid:
    • yyyy-mm-dd-hh.mm.ss
    • yyyy-mm-dd-hh.mm.ss.nnnnnn

In the following table, an A or D indicates that Db2 Admin Tool supports the data type conversion. A indicates that the object action is ALTER. D indicates that the object action is DROP or DROP-SC.

Table 2. Db2 Admin Tool data type conversions, part 2
New data type:
Original data type: sm int int float dec char vchar long vchar big int dec float (16) dec float (34) binary varbinary
small integer               A A A    
integer               A A A    
float               D A A    
decimal               A2 A A    
character                     A1 A1
varchar                     A1 A1
long varchar           A            
big integer D D D A         D A    
dec float (16) D D D D       D   A    
dec float (34) D D D D       D D      
binary                     A A
varbinary                     A A
Notes:
  1. The original column must be defined as FOR BIT DATA.
  2. Due to a potential issue when converting from DECIMAL(19,0) to BIGINT using a Db2 ALTER statement, Db2 Admin Tool performs a DROP instead along with data conversion to detect the data issue. For details, see ALTER TABLE (Db2 13 for z/OS).

If the truncation action chosen on panel ADB27CT is “Z” or “T”, the action is a DROP. Otherwise, the action is a DROP-SC. Changing NULL to NOT NULL requires a DROP operation.