Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Does Oracle Allow Retrieval of Parsed Insert Statement??

Re: Does Oracle Allow Retrieval of Parsed Insert Statement??

From: yong huang <>
Date: Thu, 01 Feb 2001 09:49:18 -0800
Message-ID: <>

Hi, Sam,

To get the rowid of the inserted row, look at Case 1 of

I'm not sure how you can view parsed SQL statement. You mean the compiled SQL? The closest you can get is v$sqlarea.sql_text.

It's not a good idea to have a table without the primary key. If you do have it, such as EMPID for the EMP table and EMPID is provided by a sequence on firing a trigger, you can use this SQL to get it:

insert into EMP (name) values ('John') returning EMPID into myPLSQLvar;

Yong Huang

you wrote:

We have a situation where we insert rows into a table, without having knowledge of the primary key. One of our developers needs to determine the rowid of such a row (primary key unknown) immediately after the row is inserted into the table.

Does anybody know if the rowid can be retrieved (or somehow returned) immediately after the row is inserted (without requerying the table)?

The rowid can also be determined by parsing the insert statement, retrieving the primary key, then querying the table for the rowid of the row. Does anybody know if Oracle has an OCI call that returns components of a parsed SQL INSERT statement. Or does anybody have a script or procedure that parses a SQL INSERT statement?

Thanks for any help.


Get personalized email addresses from Yahoo! Mail - only $35 a year!

Please see the official ORACLE-L FAQ:

Author: yong huang
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: (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 Thu Feb 01 2001 - 11:49:18 CST

Original text of this message