INSERT With Returning Clause

Submitted by:Jhon Jhon

Date added:02 November, 2014

Category:PL SQL

The RETURNING clause was implemented as part of the Oracle 10g release and is used to return information about the effected rows after issuing Data Manipulation Language (DML) statements.

Tags: returning clause , data manipulation

Code Snippet:

INSERT INTO <table> (c1, c2, .., cn) 
VALUES (v1, v2, .., vn)
RETURNING <expression>
INTO <variables>

UPDATE <table> SET (c1) = (v1), (c2) = (v2), (cn) = (vn)
WHERE <condition>
RETURNING <expression>
INTO <variables>

DELETE FROM <table>
WHERE <condition>
RETURNING <expression>
INTO <variables>
 
 

Comments