Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

execute immediate in pl/sql block not functioning

Leo KoningsMay 29 2006 — edited May 31 2006
Hello,

I've made a short plsql block which create's a bind variable on an dynamic select. when i try this in sqplus with a dbms_output.put_line(v_temp) the correct value is displayed but within the execute immediate commando the bind variable is not filled. Here's the code:

DECLARE
v_count number(5) := 1;
v_text varchar2(200);
v_temp varchar2(200);
BEGIN

select count(*) into v_count from v_survey_questions where page_id=2;
for c1 in 1..v_count
loop
v_temp:='select text into :P2_Q'||c1||' from v_survey_questions where page_id=2 and ord='||c1||'';
execute immediate v_temp;
end loop;

END;

Any help would be appreciated.
Thanks Leo.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2006
Added on May 29 2006
6 comments
502 views