Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Does Oracle Allow Retrieval of Parsed Insert Statement??
You do
not need OCI to do it. Returning supported everywhere one can use
SQL.
<SPAN
class=562413821-31012001>
Alex
Hillman
<FONT face=Tahoma
size=2>-----Original Message-----From: Jacques Kilchoer
[mailto:Jacques.Kilchoer_at_quest.com]Sent: Wednesday, January 31,
2001 1:57 PMTo: Multiple recipients of list
ORACLE-LSubject: RE: Does Oracle Allow Retrieval of Parsed Insert
Statement??
> -----Original Message----- >
From: Sam Bootsma [<A
href="mailto:SamB_at_cpas.com">mailto:SamB_at_cpas.com] <FONT size=2>> Sent: mercredi, 31. janvier 2001 10:31 <FONT size=2>> To: Multiple recipients of list ORACLE-L <FONT size=2>> Subject: Does Oracle Allow Retrieval of Parsed InsertStatement?? > >
Note: For more information about the use of the RETURNING
clause with INSERT, UPDATE, or DELETE statements, please refer to the
descriptions of those commands in the Oracle8i SQL Reference.
For a complete code example, see the demonstration programs
included with your Oracle installation. For additional information, refer to
Appendix B, "OCI Demonstration Programs".
Using DML with RETURNING Clause Using
the RETURNING clause with a DML statement allows you to essentially combine
two SQL statements into one, possibly saving you a server round-trip. This is
accomplished by adding an extra clause to the traditional UPDATE, INSERT, and
DELETE statements. The extra clause effectively adds a query to the DML
statement.
In the OCI, the values are returned to the application through
the use of OUT bind variables. The rules for binding these variables are
described in the next section. In the following examples, the bind variables
are indicated by the preceding colon, such as :out1. These examples assume the
existence of a table called table1, which contains three columns: col1, col2,
and col3.
For example, the following statement inserts new values into
the database and then retrieves the column values of the affected row from the
database, allowing your application to work with inserted rows.
INSERT INTO table1 VALUES (:1, :2, :3,) <FONT
size=2> RETURNING col1, col2, col3 <FONT size=2> INTO :out1, :out2, :out3 <FONT size=2>>>
![]() |
![]() |