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

If youre unsure in which script a sys or system-owned object is created, but you know its in a script from a specific directory, what UNIX command from that directory structure can you run to find your answer?

1730


Explain the use of inctype option in exp command.

669


Explain enable novalidate constraint.

662


What is integrity and what is constraint??Explain with example

1802


What are the oracle built-in data types?

644






Calculate difference between 2 date / times in oracle sql?

651


Explain an exception and its types?

684


How can we force the database to use the user specified rollback segment?

662


How do you tell what your machine name is and what is its IP address?

1590


What are advantages of dateset in datastage?

1869


How to define a specific record type?

700


What is a nested table and how is it different from a normal table?

660


What is a proxy object?

663


How to connect to a remote server?

642


How many types of auditing in Oracle?

655