Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: example of using clause RETURNING

Re: example of using clause RETURNING

From: Jared Still <jkstill_at_cybcon.com>
Date: Mon, 21 May 2001 19:53:40 -0700
Message-ID: <F001.0030A14B.20010521195526@fatcity.com>

How about:

DECLARE
   TYPE NumList IS TABLE OF emp.empno%TYPE;    enums NumList;
BEGIN
   DELETE FROM emp WHERE deptno = 20

      RETURNING empno BULK COLLECT INTO enums;
      -- if there were five employees in department 20,
      -- then enums contains five employee numbers
END; Jared

On Monday 21 May 2001 15:35, Hillman, Alex wrote:
> Could somebody please provide an example of returning clause for update,
> delete or insert SQL statement when there is an update, delete or insert of
> multiple rows. I know how to do it if there is one row.
>
> Alex Hillman

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jared Still
  INET: jkstill_at_cybcon.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Mon May 21 2001 - 21:53:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US