DB Sequence usage in SCD stage

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
shamail
Participant
Posts: 10
Joined: Mon Jan 12, 2009 10:36 pm

DB Sequence usage in SCD stage

Post by shamail »

Hi,

Have anyone used DB Sequence to generate Surrogate key in SCD stage.

i created a sequence in DB2 using..
CREATE SEQUENCE SEQ_SCDEMP2 AS DECIMAL(4,0) START WITH 1 INCREMENT BY 1 MINVALUE 1 NO MAXVALUE NO CYCLE NO CACHE ORDER

Then i called this in SCD stage in the surrogate key tab with the name of sequence, SEQ_SCDEMP2 and the rest of connection details.

Finally in the output tab against surrogate key i gave nextsurrogatekey(), function.

Is there anything elseI need to do.But I am getting a compile error while compiling this job. Seen similar posts in this forum but of no help. Kindly reply.

Thanks in advance,
- Shamail
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi,

What is the compilation error that you are getting?

What makes you think the compilation error is because of SCD stage?

Did you mention that the surrogate key generator is a database sequence and not a file?

--Rich
shamail
Participant
Posts: 10
Joined: Mon Jan 12, 2009 10:36 pm

Post by shamail »

Hi,

When i am hardcoding '1' instead of using nextsurrogatekey() in SCD I dont receive compilation error. And also when I am using state file in the same job pointing to a target corresponding state file the job runs successfully.

-Shamail
Althaf6553
Participant
Posts: 64
Joined: Wed Sep 26, 2007 6:52 am
Location: Syracuse ,NY

Post by Althaf6553 »

It would be better if you give the exact compilation error
Althaf
Post Reply