I am working on procedure, Please give ideas where i can develop this logic more meaning and easy
the logic is as follows
Table1 is having same Id's ABC having same seq number 100 as per legacy data (This is wrong entry in legacy data)
ID -- Seqnum
ABC -- 100
ABC -- 100
I created a table2 where it will have max seqnum from legacy for this ID's for example ABC
ID -- Max seqnum
ABC --500
In my procedure I will have two cursors
First cursor will be have Table1 detail
Second Cursor will have Table2 Details
In above ex the table will have the first record should be unchanged i.e.,
ABC -- 100 --100
but second record will change to
ABC -- 100 -- 501(This next value of the max seq number from table 2/Cursor 2)
I have to create third column which will hold the next seqnumber for that ID ABC
I should load both records changing the seqnumber so I will not have any duplicate records for same ID.
So final records will look like
ID Seq# Final_Seq#
ABC -- 100 -- 100
ABC -- 100 -- 501
Thanks in advance.