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: execute immediate

Re: execute immediate

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Sun, 19 Jun 2005 12:56:01 +0200
Message-ID: <d93im0$usc$1@news6.zwoll1.ov.home.nl>


astalavista wrote:
> hi,
>
> I built a dynamic query in PL/SQL
> when I did
>
>

>>spool test.sql
>>...
>>stmt := select col1,col1.. from ...
>>dbms_output.put_line(stmt);
>>@test.sql

>
>
> the result is OK
>
> When I did
>
>>execute immediate stmt ;

>
> nothing on the screen
>
> obviously I misuse execute immediate
> can you help me please ?
>
> Oracle 9.2.0.5
> HP-UX 11.0
>
>

First of all: do not use dynamic sql if you can avoid it.
Second: the execute immediate is in another context (one of the reasons you had better avoid it - context switching is resource demanding). Of course you could read the manual and find out about binding using exec imm using / into, and pass the results back to your calling context.
-- 
Regards,
Frank van Bortel
Received on Sun Jun 19 2005 - 05:56:01 CDT

Original text of this message

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