Re: Execute Immediate : Can't run ...Please help

From: Sybrand Bakker <gooiditweg_at_nospam.demon.nl>
Date: Sat, 23 Apr 2005 11:09:25 +0200
Message-ID: <v04k61p9vmn6em3njooqlrd3fn9vq7ahh0_at_4ax.com>


On 22 Apr 2005 08:06:21 -0700, zislam_at_gmail.com (Pial) wrote:

>Can anybody tell me what's the wrong with the EXECUTE IMMEDIATE. I am
>just pasting the code. The problem is in the EXECUTE IMMEDIATE strSql;

The problem is you seem to think execute immediate supports cursors. It doesn't. It can run select into's assuming you use bindvariables (execute immediate 'select name into :temp from emp where empno = 10' using temp -- where temp is a variable)
, but you can't fetch multiple records.
For *that* you need OPEN <cursor variable> FOR 'select... ' etc.

So I guess some reading is in order.

--
Sybrand Bakker, Senior Oracle DBA
Received on Sat Apr 23 2005 - 11:09:25 CEST

Original text of this message