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 / 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 |
Explain the difference between a procedure and a function?
How to restrict the duplicate records in table valuesets
How to use subqueries in the from clause in oracle?
How do we switch from init.ora file to asp file?
What is catalog in Oracle?
How to export your connection information to a file?
Can anyone give me information about oracle certification
How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?
What is PL/SQL ?
Explain an index?
What is the quickest way to fetch the data from a table?
What happens to the current transaction if the session is killed?