Alternative way

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

prasad v wrote:
chulett wrote:I was responding to your concerns that if you had gaps in the sequence that those gaps would somehow lead to duplicates being generated in subsequent runs, which is... wrong.
We do update one table with latest Seq Number+no.of records in the present run.
That's your problem. You should be updating it with the maximum sequence used in the 'present run'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Devendrudu
Participant
Posts: 31
Joined: Tue May 24, 2011 12:16 am

Post by Devendrudu »

Use this formula.

[@Partition number + (@INROWNUM-1)*@NUMBER PARTITIONS+1]
Devendra,Bangalore,India
prasad v
Participant
Posts: 174
Joined: Mon Mar 30, 2009 2:18 am

Post by prasad v »

Devendrudu wrote:Use this formula.

[@Partition number + (@INROWNUM-1)*@NUMBER PARTITIONS+1]
It does n't work
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

I don't understand why you require anything like that.

The few points mentioned by other posters says it all.
1. Surrogate keys are just to maintain uniqueness and it should not matter whether there is a gap or not.
2. In case its absolutely required, which I cannot justify,
a) use surrogate key generator with block size as 1.
b) use database sequence with cache size as 1 if its a database.
c) utilize @OUTROWNUM while running transformer in sequential mode.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Regarding 2a and 2b, don't use these options with when processing high quantities of data (millions of rows) unless you feel you absolutely have to. Your job performance will likely be severely degraded.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Yes, that is price for the absolute need of generating surrogate keys without GAP. I had 1 situation earlier where I had to do this on customer requirement but that was only for Job Control Purpose and not related to data load. Like for Audit and control purpose for every run we used to generate like 5 records per day, run ids of 5 modules. In that case it was a workable solution. but not always. IMO.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply