surrogate key generating off numbers

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

Post Reply
Damonsal
Premium Member
Premium Member
Posts: 16
Joined: Wed May 07, 2014 11:29 am

surrogate key generating off numbers

Post by Damonsal »

I am developing a new job to an existing target table. I decided to initialize the seq with max+1 value to skey file and do an update/insert into the table, so created job to load the data to the target table, whenver there is no lookup found i generate the SKey from the utility, data is generated correctly. but i see the Skey generation is generating numbers which are less than the max
+1 value which i set in intialization stage. please advice the workaround.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am

Post by ArndW »

The surrogate key generator will always generate numbers that are higher than the previous call or the initial value setting. If this is not the case, then check your initial value setting and perhaps that did not work as you expected.
Try running your sequence or job that sets the surrogate key minimum. Then write a dummy job which gets the next value and writes it to a peek or a flat file and check that value.
<a href=http://www.worldcommunitygrid.org/team/viewTeamInfo.do?teamId=TZ9H4CGVP1 target="WCGWin">
Image</a>
Post Reply