Column mapping rules
Fromcolumn with a data type that is incompatible with the data type of the
Tocolumn. For example, From Column Mapping panel showing Delete “From column” selected shows the two DATE
Fromcolumns, HIREDATE and BIRTHDATE, as un-selectable for mapping to the numeric
Tocolumn, BONUS.
“From” column | “To” column | ||||
---|---|---|---|---|---|
DATE | TIME | TIMESTAMP | Character | Numeric | |
DATE | Yes | No | No | Yes | No |
TIME | No | Yes | No | Yes | No |
TIMESTAMP | Yes1 | Yes2 | Yes3 | Yes | No |
Character4 | Yes5 | Yes5 | Yes5 | Yes | Yes6 |
Numeric7 | No | No | No | No | Yes |
- DATE
- If the “From” column has a data type of TIMESTAMP, only bytes 1–4 of the “From” column are moved to the “To” column; otherwise, the full four bytes of the “From” column are moved to the “To” column.
- TIME
- If the “From” column has a data type of TIMESTAMP, only bytes 5–7 of the “From” column are moved to the “To” column; otherwise, the full three bytes of the “From” column are moved to the “To” column.
- TIMESTAMP
- When the data types of the "FROM" and "TO" columns are identical
all bytes of the "From" column are moved to the "To" column.
When the precision and TIME ZONE components of the "FROM" and "TO" columns are different:
- Excess digits are lost in the fraction part of the second when the precision of the "FROM" column is greater than the precision of the "TO" column.
- The fractional part of the second is padded on the right with zeroes when the precision of the "FROM" column is less than the precision of the "TO" column.
- TIME ZONE information is lost when the "FROM" column includes a TIME ZONE and the "TO" column does not.
- TIME ZONE information is added when the "FROM" column does not include a TIME ZONE and the "TO" column does.
- Character
- The data is aligned at the leftmost character position and, if
necessary, truncated or padded with spaces at the right.
If the “From” column is a numeric column, the absolute (unsigned) value is used. If the column is defined as signed and the sign occupies a separate character, that character is not moved, and the sending item is considered to be one less character than the actual size.
- Integer or packed
- The data is aligned on the assumed decimal point and, if necessary,
truncated or padded with zeros. If an assumed decimal point is not
explicitly specified in the column definition, one is assumed immediately
to the right of the column.
If the “From” column is numeric, the data is moved as if both the “From” column and “To” column were described as signed.
If the “From” column is alphanumeric, the data is moved as if the “From” column were described as a signed numeric.
- Internal floating-point
- A decimal point is assumed immediately to the left of the column. The data is aligned on the leftmost digit position following the decimal point, with the exponent adjusted accordingly.
- External floating-point
- The data is aligned on the leftmost digit position, and the exponent adjusted accordingly.
Related tasks
TIMESTAMP(4) -> TIMESTAMP(10)
2012-12-02-12.34.56.1234 2012-12-02-12.34.56.1234567890
TIMESTAMP(4) WITH TIME ZONE -> TIMESTAMP(0)
2012-12-02-12.34.56.1234-12:00 2012-12-02-12.34.56
Tocolumn is set to the default value as specified by data create attributes. If the Db2® installation-defined format for dates or time is LOCAL, FM/Db2 is unable to validate the
Fromcolumn before inserting it into the
Tocolumn.