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
Database is hung. Old and new user connections alike hang on impact. What do you do? Your SYS SQLPLUS session IS able to connect.
Explain the difference between a procedure and a function? What do you understand by those terms?
What is meant by recursive hints in oracle?
What is an Oracle index?
What are operators in oracle?
How to return top 5 rows in oracle?
Explain an index?
How to execute a stored procedure in oracle?
How can we find out the current date and time in oracle?
What is the max number of columns in an oracle table?
What are the tools for Oracle ?
How to delete all rows a table in oracle?
When do you get a .pll extension in oracle?
In SAP ECC 6.0 , under DB02 tcode , Tablespace name to be explain stepy step all the col
How to load data through external tables?