Reading a source file with salary prefix $ , in the target the Sal column must store in number .
Source
EMPNO ENAME JOB MGR HIREDATE SAL DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 $800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 $1600 30
Target
EMPNO ENAME JOB MGR HIREDATE SAL DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 30
Source
EMPNO ENAME JOB MGR HIREDATE SAL DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 $800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 $1600 30
Target
EMPNO ENAME JOB MGR HIREDATE SAL DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 30
- Drag the source to mapping area and connect each port to an expression transformation.
- In expression transformation add a new col sal1 and make it as out put and sal as in put only as shown in picture.
- In expression write the condition like this.
- connect the required port to target.
Converting '$' symbol to 'RS." in sal column
Q24 The Emp table contains the salary and commission in USD, in the target the com and sal will converted to a given currency prefix ex: Rs.
Source
EMPNO ENAME JOB MGR HIREDATE SAL DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 $800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 $1600 30
Target
EMPNO ENAME JOB MGR HIREDATE SAL DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 Rs.800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 RS.1600 30
- Drag the source and connect it to expression transformation
- In expression make a output port sal1 and make sal as input port only.
- In sal1 write the condition as like bellow
- Then send it to target.
No comments:
Post a Comment