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

Home -> Community -> Usenet -> c.d.o.server -> Re: Q: where can I find sql for a procedure in memory ?

Re: Q: where can I find sql for a procedure in memory ?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 11 Jan 2000 08:18:56 -0500
Message-ID: <t7bm7so5j4krmlnvrgr0praui21qn08fo1@4ax.com>


A copy of this was sent to tedchyn_at_yahoo.com (if that email address didn't require changing) On Mon, 10 Jan 2000 22:22:55 GMT, you wrote:

>Sir,
> Is it true pl/sql procedures are preparsed therefore the sql will not
>appear in sql area ?
>

plsql is compiled into P-Code. The procedural part of plsql is 'compiled' at compile time. All sql within plsql is parsed out at this time and stored. At runtime, the SQL (inserts/updates/deletes/selects/etc) that plsql run is submitted to the database engine as any sql would be. The first time the datbase sees a sql statement from plsql, it'll be parsed - optimized - etc and stashed in the shared sql area for others to use and reuse.

So - plsql is 'preparsed' and turned into p-code. The sql within is parsed and rewritten (bind variable replacement and all) at compile time.

At runtime, this rewritten SQL is submitted to the database as would any sql from any client be submitted. It is visible in the sql area (albeit in a slightly different fashion then you coded it as plsql rewrites your sql. case will change, bind variables will be injected and so on)

>Thanks Ted
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Jan 11 2000 - 07:18:56 CST

Original text of this message

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