Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Updating a column with PL/SQL proc
"andrija" <ar35644_at_fer.hr> wrote in message news:<9vckgu$he9$1_at_as201.hinet.hr>...
> > begin
> >
> > execute immediate 'update test_plup set ' || clname || ' = :val1'
> > using val1;
> >
> > end;
> >
>
> What's the difference between
>
> execute immediate 'update test_plup set ' || clname || ' = :val1'
> using val1;
>
> and
>
> execute immediate 'update test_plup set ' || clname || ' = ' || val1;
The former will be hardparsed only once, at first execution, the latter will be hardparsed on every call. Generally speaking you should avoid this construct like hell as it will severely limit the scalability of your app, as it will become completely cpu-bound. Evidently the difference is also explained in the Oracle docs, as 'bind variable'
Hth
Sybrand Bakker
Senior Oracle DBA
Received on Fri Dec 14 2001 - 08:44:42 CST