Hi,
I am currently loading to many DB2 Tables who use a Sequence to extract the Key field.
I am using user-defined SQL for all these inserts ==>
INSERT INTO PRFWSTG.JPTEST(JP_KEY, JP_NOTE) VALUES (NEXTVAL FOR PRFWSTG.SQC_JPTEST,?);
Is there anyway to use the NEXTVAL function in the TRANSFORMER derivation area? It's no big deal to use the User-defined SQL but I figured if it could be done......
Thanks - - John
DB2 NEXTVAL
Moderators: chulett, rschirm, roy
Re: DB2 NEXTVAL
Hi John,
You can not use the NEXTVAL function directly to access the DB2 Sequence, but you can use the transform KeyMgt.
You can refer this post for more details
[url]viewtopic.php?t=84670&highlight=DB2+SEQUENCE[/url]
-NB
You can not use the NEXTVAL function directly to access the DB2 Sequence, but you can use the transform KeyMgt.
You can refer this post for more details
[url]viewtopic.php?t=84670&highlight=DB2+SEQUENCE[/url]
-NB
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
If you were confident you running the only job updating the sequence for the duration of the job you could call it prior to the start of the job (from a sql script run by a sequence job) and pass it in as a job parameter, increment it in a transformer, update it at the end of the job (via the after-sql tab) to the counter value.
This is one of the reasons why I recommended ETL surrogates in Why database generated surrogate keys drive me nuts!!!
This is one of the reasons why I recommended ETL surrogates in Why database generated surrogate keys drive me nuts!!!
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn