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 |
What are the factors causing the reparsing of SQL statements in SGA?
what is the difference between primary key & foreign key?
57 Answers CTS, Infosys, La Multi, Sparsh, Wipro,
How to define a sub function?
How to define a record variable to store a table row?
Explain the use of tables option in exp command.
What is Private Database Link ?
How to create a new view in oracle?
What do you understand by a database object? Can you list a few of them?
How to select some columns from a table in oracle?
What is materialized view in Oracle?
what is the difference between dbms and rdbms?
What is an oracle?