Pages

Sunday, March 17, 2013

Suppose we have a table with records like this


EMPNO        HIRE_DATE         
------ ----       -----------
     1             12-11-87
     2             02-04-88;
     3             02-2323
empno is number and hire_date is in string format. We have to check the hire_date column, if it is in date format like 'dd-mm-yy', then convert it to date , in the  format  “mm/dd/yy”  and send it to target  else send null.
output
    EMPNO       HIRE_DATE
    --------          ---------
       1             11-DEC-87
       2                null
       3               null
These are the steps for achieving this scenaio
  1. Connect the ports from SQF to an expression transformation.
  2. In expression create another oupput port hire_date1 and make it to date data-type, shown in picture.
  3. In Hire_date1 write the condition like this.
  4. Send ports to target.

No comments:

Post a Comment