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


Please Help Members By Posting Answers For Below Questions

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?

518


How to define a specific record type?

612


how do u setup a replication site?

1490


Explain the use of log option in exp command.

529


How to use values from other tables in update statements using oracle?

562






Is primary key indexed by default in oracle?

538


does the query needs a hint to access a materialized view?

1458


How to loop through a cursor variable?

563


What are the differences between char and nchar in oracle?

589


What do you mean by merge in oracle and how can we merge two tables?

571


Explain oracle 12c new features for developers?

534


Which environment variables are absolutely critical in order to run the OUI?

1644


1) Does oracle have any table which contain all the exceptions and it's code internally?

1277


How to define an anonymous block?

612


What is Java Pool in Oracle?

596