generate Unique sequence numbers for each partition in session with Unconnected Lookup ?
Hi All,
Please help me to resolve the below issue while Applying partitioning concept to my Session.
This is a very simple mapping with Source, Lookup , router, and target.
I need to Lookup on the target and compare with the source data, if any piece of data is new then Insert, and If any thing change in the existed data then Update.
while Inserting the new records to the target table I'm generating sequence numbers with Unconnected lookup, by calling the maximum PK ID from the target table.
The above flow is working fine from last one year.
Now I wish to apply the Partitioning concept to the above floe(session)
At source I used 4 pass through partitions.(For Each partition different filter conditions to pull the data from source)
at Target I used 4 passthrough Partitions.
it is working fine for some data, but for some rows for Insert Operation , it is throwing Unique key errors, because while Inserting the data it is generating the same sequence key twice.
In detail : 1st row is coming from 1st partition and generated the sequence number 1 for that row.
2nd row is coming from 1st partition and generated the sequence number 2 for that row
3rd row is coming from the 2nd partition generated the sequence number 2 again for that row. (it must generate 3 for this row)
the issue is becuase of generating the same sequence numbers twice for different partitions.
Can any one Please help me to resolve this issue.
While Applying partitions how can I generate a Unique Sequence numbers from Unconnected lookup for Each partitioned data.
Regrads,
N Kiran.
Answers were Sorted based on User's Feedback
Answer / sufi
Most simple way to handle this type scenario is use DB Sequence Generator (write Stored Procedure) and Trigger on INSERT on top of it.
| Is This Answer Correct ? | 2 Yes | 0 No |
Hi,
Take one parameter (i.e. $$seq) and assign initial value for the unique key (i.e. 1000). Now, from Source Qualifier take all the ports to one expression transformation. Add two additional ports in the Expression Transformation as below.
v_seq (variable port) = IIF(v_seq>0,v_seq+1,$$seq)
SEQ_NO (output port) = v_seq
In this way, the Sequence transformation can be avoided but we will have the same facility in partition scenario as we are changing the port values only.
Though I believe it will work but please let me know if it is not.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the modules in Power Center
Hi, I am new to Informatica, What is a flat file and how to use flat file in infomratica please help me.
Under what condition selecting sorted input in aggregator may fail the session?
5. Consider the following products data which contain duplicate rows. A B C C B D B Q1. Design a mapping to load all unique products in one table and the duplicate rows in another table. The first table should contain the following output A D The second target should contain the following output B B B C C
Filter transformation in the condition one of the data is NULL would the record be dropped.
What is workflow? What are the components of workflow manager?
why we need informatica
What is use of batch file in informatica? How many types of batch file in informatica?
Explain the different dimensions.
what is the difference between informatica6.1 and infomatica7.1
scenario: dept_no emp_nem 10 A, 10 B, 10 C, 10 D, 20 P, 20 Q, 20 R, 20 S output: dept_no emp_nem 10 A, 10 AB, 10 ABC, 10 ABCD, 20 ABCDP, 20 ABCDPQ, 20 ABCDPQR, 20 ABCDPQRS
Explain sessions and how many types of sessions are there?