delete and insert in one transaction

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

delete and insert in one transaction

Post by admin »

Hello you all,

New becomer to this mailing-list, thanks to the Ascential Support Team ;o), id like to submit to you a "simple" request : "Is it possible to make a selective deletion, then an insertion, in an only transaction" (these last words are truly important).

For example, if the rows to insert are

FIELD_1 FIELD_2 FIELD_3
AA AA AA
AA BB BB
AA CC CC
(very nasty)

wed like to perform the two statements :

delete from table
where FIELD_1 like AA ;

insert into table
values (?, ?, ?) ;

with a general rollback if any of both fails.

Uh, i think you have it. Were using DataStage 4.0, dealing with Oracle 8 bases (using the DataStage OCI 8.0, or ODBC stages as well)...

Lets see if you have a clue (the answer will do the trick too ;o)

--
Aurelien
Locked