How to extract original records at one target & Duplicate
records at one target?
Answers were Sorted based on User's Feedback
Answer / sks
Hi,
Yes you can do it by using Expression transformation as
well. Infact, by using 2 SQ (source qualifier) and using
sql queries (as I explained earlier), you can perform the
required task on relational tables only (but not on flat
files etc).
In the case of flat files as source, you will need to use
Expression transformation. But you also need to use sorter
before expression (otherwise record flag will change for
every incoming record & duplicates won't be traced). The
sequence of transformations will be as follows -
Source -> SQ -> Sorter ->Expression ->Router(or 2 filters) -
>Targets
Is This Answer Correct ? | 6 Yes | 1 No |
yes... add a new column in the sql override by calculating
the count(*) to get how many times the record is repeating.
Using Router we can seperate them into two different
targets.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / davan
sq-->sort--exp--riuder--tg1--tg2
In exp V_flag=iif(empno=p_empno,v_flag+1,1)--variable port
p_empno=empno--variable port
0_flag=v_flag--output port
In rouder o_flag>1 one target,default one target
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kumar
The scenario's.. i want, duplicate records from a table to a
target.. n remaining records to b on another target...
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / sunil
Its not very clear by using expression transformation.Can
any one eloberate. I am creating one variable port VAR_EMPNO
in exp and giving value as EMPNO.Created one output port
EMPVAR_OP with cond : IFF(EMPNO = VAR_EMPNO,1,0) Based on
this I am filtering and redirecting to two targets but its
not working, is the expression fine over here?
Is This Answer Correct ? | 1 Yes | 2 No |
Answer / sks
Hi,
If I understand your question correctly, then it is like-
How to send original (distinct) records to one target
(let's say TA) and duplicates to another target (let's say
TB).
It can simply be done as follows -
In your mapping, take the source table containing whole
records (duplicates as well). Now, take 2 source qualifier
(SQ) transformations. The first SQ should
contain 'Distinct' sql query (hope you know that) and the
output ports should go to TA table.
The second SQ should contain the following sql stmt (which
filters only the duplicate records) -
-------------------------------------------
SELECT empno, ename, job, mgr, hiredate, sal, comm, deptno
FROM (SELECT empno, ename, job, mgr, hiredate, sal, comm,
deptno, ROW_NUMBER() OVER (PARTITION BY empno ORDER BY
EMPNO) rn FROM s_assign_1_emp)
WHERE rn > 1
-------------------------------------------
I am using emp table example (hope you can understand it).
Now, the output ports of the seecond SQ should go to TB
table.
This is the simplest way of doing it. Hope it will help.
If you feel any issue, please let me know at
shrikant_rps@yahoo.com
Is This Answer Correct ? | 1 Yes | 3 No |
What is surrogate key?
Can we override a native sql query within informatica?
What is informatica metadata and where is it stored?
what is difference between dimention table and fact table?
In Joiner Transformation, how to identify the master and detail tables if one is from Oracle and the other is from Sybase.
what are the settiings that u use to cofigure the joiner transformation?
To import the flat file definition into the designer where should the flat file be placed?
can we create index and drop index in exsisting table while using infomatica
My flat file source is C_Id 1-nov-2011 8-nov-2011 100 2000 1500 101 2500 2000 I want my Target as C_Id Week_Num Amt 100 45 2000 100 46 1500 101 45 2500 101 46 2000
How informatica recognizes mapping?
why we are using surogate key in real time give me explanation
i did MBA in 2008. i got job as a Software Engineer(Informatica) in 2008 February in our college campus interviews through consultancy. my problem is when iam going interview HR people ask " YOu are MBA graduate how u get software(informatica) job". iam saying i got job in campus interviews. i have knowledge in informatica in dataware housing. is this answer correct or not. plese give me guidence