Page 1 of 1

DB Sequence usage in SCD stage

Posted: Mon Feb 09, 2009 12:17 am
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

Posted: Mon Feb 09, 2009 1:55 am
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

Posted: Mon Feb 09, 2009 2:53 am
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

Posted: Mon Feb 09, 2009 4:18 am
by Althaf6553
It would be better if you give the exact compilation error