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



generate Unique sequence numbers for each partition in session with Unconnected Lookup ? Hi..

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

generate Unique sequence numbers for each partition in session with Unconnected Lookup ? Hi..

Answer / subhrangshu

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

Post New Answer

More Informatica Interview Questions

How do you load first and last records into target table?

0 Answers  


write sql query following table amount year quarter 1000 2003 first 2000 2003 second 3000 2003 third 4000 2003 fourth 5000 2004 first 6000 2004 second 7000 2004 third 8000 2004 fourth i want the output year q1_amount q2_amount q3_amount q4_amount 2003 1000 2000 3000 4000 2004 5000 6000 7000 8000

1 Answers   HP,


Q. In source area, it is use complex query we have using 5 to 10 table we has been join now all join clolumn having indexes but still we having performance issue. how to fix the performnce issue of the query.

0 Answers  


Is stop and abort are same in informatica?

0 Answers  


What does update strategy mean, and what are the different option of it?

0 Answers  






hw to load this give the mapping? cty state o/p c1 s1 c1 c1 s2 s1 c1 s1 c1 c2 s3 s2 c3 s4 c1 c3 s2 s1 c2 s3 c3 s4 c3 s2 2 columns should be loaded to one column in target table?

1 Answers   Wipro,


hi guys i have an question how do you find out weather the column is numeric or combination of char and numbers or it contains char,numeric and special characters.

2 Answers   IBM,


When will you use SQL override in a lookup transformation?

1 Answers  


How we can create indexes after completing the loan process?

0 Answers  


what is Partitioning ? where we can use Partition?

2 Answers   IBM, TCS,


Differnce between filter and router?

14 Answers   IBM,


What is confirmed dimension and fact?

7 Answers  


Categories