CREATE SEQUENCE STEVE.SEQ_KEY_ACCTS
AS INTEGER
START WITH 1
INCREMENT BY 1;
CREATE TABLE STEVE.TESTSEQ LIKE NEG085_20090210.ACCOUNT;
INSERT INTO STEVE.TESTSEQ
SELECT * FROM NEG085_20090210.ACCOUNT ORDER BY SRC_SYS_ACCT_KEY FETCH FIRST 10 ROWS ONLY;
ALTER table STEVE.TESTSEQ ADD COLUMN NEW_SRC_SYS_ACCT_KEY INTEGER;
UPDATE STEVE.TESTSEQ SET NEW_SRC_SYS_ACCT_KEY = nextval for STEVE.SEQ_KEY_ACCTS;
Can any one help us regarding above logic for DB2 sequence develop in Datastage
Advance thanks for your help
Thanks
PARAM
Logic for DB2 sequence develop in Data stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 40
- Joined: Mon May 18, 2009 5:22 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The DDL pieces can be done in Before-SQL.
The DataStage job should select the first 10 rows and pass these through to an INSERT statement.
Create the key column up front and include the reference to the sequence within user-defined SQL.
The DataStage job should select the first 10 rows and pass these through to an INSERT statement.
Create the key column up front and include the reference to the sequence within user-defined SQL.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.