I am new to DataStage and I am having a problem combining 2 inputs.
I have a sequential file which I need to load into a DB2 table. The table contains a serial number which is obtained from a sequence. The next sequence number is obtained by entering the following custom SQL satement:
select next value for alerts.seq_sn_log from sysibm.sysdummy1;
I need to load the DB2 table with the data from the sequential file and the sequence number from the database however I cannot combine the 2 inputs into one file to load into the database.
What is the best way to handle with this problem?
Problem combining 2 inputs
Moderators: chulett, rschirm, roy
-
vmcburney
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
We retrieve the DB2 sequence numbers during the insert by using NEXT VAL as the insert value via user-defined SQL:
This statement will retrieve the next sequence number from the CUSTOMER_SEQ each time an insert statement is run.
Code: Select all
INSERT INTO CUSTOMER
CUSTOMER_ID, CUSTOMER_NAME, CUSTOMER_ODOR
(NEXT VAL FOR #DB_SCH#.CUSTOMER_SEQ, ?, ?)This statement will retrieve the next sequence number from the CUSTOMER_SEQ each time an insert statement is run.
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