This article mainly addresses some of the issues that need to be paid attention to during the actual operations from Oracle database to DB2 data migration, the following is an introduction to some of the actual operations from Oracle database to DB2 data migration that require attention.
1. decode in Oracle
DB2 solution: Use case conditional expressions.
Two syntax modes of case:
(1) CASE
WHEN condition THEN result 1
ELSE result 2
END
(2) CASE expression 1
WHEN expression 2 THEN result 1
ELSE result 2
END
The above WHEN can be repeated multiple times, just like the expression of SWITCH... CASE in C.
For example:
Select ordno, CUSNO,
Case month (SHIPDATE)
WHEN ''01 ''then'' 'Jan''
WHEN ''02 ''then'' 'feb''
WHEN ''03 ''then'''mar''
WHEN ''04 ''then'' apr''
WHEN ''05 ''then'' May''
WHEN ''06 ''then'' 'jun''
WHEN ''07 ''then'' 'jul''
WHEN ''08''' then''' aug''
WHEN ''09''' then''' sep''
WHEN ''10''then'' 'oct''
WHEN ''11''' then''' nov''
WHEN ''12'' then'' 'dec''
END
FROM FILE
The above content is an introduction to some of the data migration solutions from Oracle to DB2.