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
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?
What is a table index in oracle?
Can the query output be sorted by multiple columns in oracle?
How to use "in" parameter properly?
What is a initialization parameter file in oracle?
Why should I use oracle database?
Hi Masters, in Oracle Applications 11i, we hace 2 functions using the same form, i need to create 1 personalization, but that code must afect only one function.... how can i do that?
How a database is related to tablespaces?
How to connect to a local oracle 10g xe server?
How to execute the package in oracle?
types of indexes and the rationale behind choosing a particular index for a situation.
How to compare dates in oracle sql?
How i can handle exception in large code like 1000 line without distrubing the code or without exception handler sction?
What is oracle server autotrace in oracle?
6. Display the client name and order date for all orders using the traditional method.