Re: SELECTing from a DML statement
Date: Fri, 04 Jul 2008 09:44:18 -0400
> DB2 allows one to select from an insert, update, or delete, e.g.:
> select * from old table (delete from x where y = 1);
> select * from new table (update x set y = 1 where z = 2);
> select * from final table (insert into x (c1) values (1));
> Is there any equivalent in Oracle?
Oracle supports a clause after the UPDATE/DELETE/INSERT statement called
RETURN INTO (or RETURNING??). Somewhat similar to the OUTPUT clause of
It may be sufficient for what you want to do. If you operate on more than one row then you'd typically dump the result into an associative array of rows in PL/SQL and use FORALL, etc for further processing.
-- Serge Rielau DB2 Solutions Development IBM Toronto LabReceived on Fri Jul 04 2008 - 08:44:18 CDT