Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL:Efficiency of inline SQL vs use of Dynamic SQL Package
> I am writing an application in PL/SQL which involves many SQL insert
> statements where I require a count of the number of records for each insert.
>
> My query is whether 1. It is more efficient to perform SQL inline and use
> select count(*) to return the number of rows;, or, 2. Use the dynamic SQL
> package which also returns the number of rows inserted.
Dynamic SQL is far less efficient than hard coded SQL or PL/SQL. And in some versions such as 7.1.4 and 7.1.6 (VM mainframe) leaks memory. The reason to use DSQL is if you have to or if coding around it would be extremely difficult or involve disk I/O.
Daniel A. Morgan Received on Mon Sep 14 1998 - 23:44:31 CDT