create or replace procedure show_tab_rec ( P_tab VARCHAR2 )
IS
cmd varchar2(50);
begin
cmd := 'select *
from '|| P_tab;
for int in ( execute immediate cmd )
loop
dbms_output.put_line ( int.ename||' '||int.deptno);
end loop;
end;
when i m compling this procedure i m getting this error
PLS-00103: Encountered the symbol "IMMEDIATE" when expecting
one
of the following:
. ( ) , * @ % & | = - + < / > at in is mod remainder not
range rem => .. <an exponent (**)> <> or != or ~= >= <= <>
and or like LIKE2_ LIKE4_ LIKEC_ between || multiset member
SUBMULTISET_
PLZ solve this error
give this question answer asap
Thanks advance.......
Answer Posted / satish
we can't use execute immediate in for loop cursor.So,we can
use ref cursor instead of this to achieve this solution
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the effect of setting the value "all_rows" for optimizer_goal parameter of the alter session command? What are the factors that affect optimizer in choosing an optimization approach?
How to define a specific record type?
how do u setup a replication site?
Explain the use of log option in exp command.
How to use values from other tables in update statements using oracle?
Is primary key indexed by default in oracle?
does the query needs a hint to access a materialized view?
How to loop through a cursor variable?
What are the differences between char and nchar in oracle?
What do you mean by merge in oracle and how can we merge two tables?
Explain oracle 12c new features for developers?
Which environment variables are absolutely critical in order to run the OUI?
1) Does oracle have any table which contain all the exceptions and it's code internally?
How to define an anonymous block?
What is Java Pool in Oracle?