Informatica Scenario: Replacing Duplicate IDs (First 2 Char with XX)
SRC
--------
1001 A
1002 B
1003 C
1001 D
1002 E
TGT
---------
1001 A
1002 B
1003 C
xx01 D
xx02 E
Solution:
SRC-SQ-SRT-EXP-TGT
_____________________
SRT: Order by ID ASC
* Instead of Sorter we can use SQL Override functionality in Source Qualifier to order the data.
-------------
EXP :
Ports:
-------------
ROW_ID :
v_ROW_ID : IIF(ROW_ID=v_ROW_ID,
REPLACESTR(1,ROW_ID,SUBSTR(ROW_ID,0,2),'xx'),ROW_ID)
v_pre_row_id : v_ROW_ID
Name:
SQL Meta Data for Practice: ____________________________ CREATE TABLE Dup1(row_id varchar(10),name varchar2(100)); INSERT INTO DUP1 VALUES('1001','A'); INSERT INTO DUP1 VALUES('1002','B'); INSERT INTO DUP1 VALUES('1003','C'); INSERT INTO DUP1 VALUES('1001','D'); INSERT INTO DUP1 VALUES('1002','E'); COMMIT;
0 Comments