Oracle query in DS job!!
Posted: Thu May 17, 2007 1:12 pm
I am using OCI stage to insert/update rows in Oracle database. I am using update/insert query. I want to insert all rows but update all but 1 row. So in the OCI stage, I use user defined SQL
INSERT INTO <TABLE> (Col1, Col2, Col3, Col4) VALUES (:1,:2,TO_DATE(:3, 'YYYY-MM-DD HH24:MI:SS'),:4);
UPDATE <TABLE> SET Col1=:2,Col3=TO_DATE(:3, 'YYYY-MM-DD HH24:MI:SS') WHERE Col1=:1
As you can see, I don't want to update Col4 in the UPDATE statement... I thought this would work but DS/Oracle errors out saying illegal variable/number... But if put in Col4 in the update statement, it works fine..
How do I fix this? I don't want to update Col4 ...
Thanks much !!
INSERT INTO <TABLE> (Col1, Col2, Col3, Col4) VALUES (:1,:2,TO_DATE(:3, 'YYYY-MM-DD HH24:MI:SS'),:4);
UPDATE <TABLE> SET Col1=:2,Col3=TO_DATE(:3, 'YYYY-MM-DD HH24:MI:SS') WHERE Col1=:1
As you can see, I don't want to update Col4 in the UPDATE statement... I thought this would work but DS/Oracle errors out saying illegal variable/number... But if put in Col4 in the update statement, it works fine..
How do I fix this? I don't want to update Col4 ...
Thanks much !!