We are trying to insert current value of DB sequence into a table in Oracle stage. But while executing the job its throwing an error as unable to insert the record. Where as nextval is working.
My query is:
INSERT INTO RUN_DETAIL (BATCH_RUN_ID) VALUES (run_seq.currval)
Pbm using CURRVAL in datastage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 80
- Joined: Fri Aug 21, 2009 7:49 am
- Location: India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Create a job that SELECTs the current value then passes this to the Oracle table using a regular INSERT (one with a VALUES clause containing a parameter marker).
DataStage wants to pass a value for at least one column for an INSERT.
DataStage wants to pass a value for at least one column for an INSERT.
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.
-
- Participant
- Posts: 80
- Joined: Fri Aug 21, 2009 7:49 am
- Location: India
Pbm using CURRVAL in datastage
when iam trying to insert a record into the table fetching the value from oracle sequence jus as in the query mentioned it is throwing me the error
"run_seq.CURRVALUE is not yet defined in the session"
my jobs looks something like this
oraclestage1->copystage->oraclestage2
|
v
sequential file
in oracle stage 1 iam reading the value from the sequence using run_seq.NEXTVAL and inserting that value in both my sequntialfile and oraclestage2.
i am getting the correct value from oraclestage1 but when iam trying to insert the value into my oraclestage2 it is throwing me the above error.
can anyone please suggest me solution for this?
TIA
"run_seq.CURRVALUE is not yet defined in the session"
my jobs looks something like this
oraclestage1->copystage->oraclestage2
|
v
sequential file
in oracle stage 1 iam reading the value from the sequence using run_seq.NEXTVAL and inserting that value in both my sequntialfile and oraclestage2.
i am getting the correct value from oraclestage1 but when iam trying to insert the value into my oraclestage2 it is throwing me the above error.
can anyone please suggest me solution for this?
TIA
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 80
- Joined: Fri Aug 21, 2009 7:49 am
- Location: India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: