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.......



create or replace procedure show_tab_rec ( P_tab VARCHAR2 ) IS cmd varchar2(50); begin cmd := &#..

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

Post New Answer

More Oracle General Interview Questions

What is truncate oracle?

0 Answers  


what is the syntax of CREATE command?

8 Answers  


Is there any way to find out when one specific table/view/M-view is used last time. i.e. when one specific object is used in any SELECT statement.

0 Answers   Infosys,


Does oracle partitioning improve performance?

0 Answers  


What is the difference between Sleep and Wait? (Java)

1 Answers   RBS,






What is index-organized table in Oracle?

0 Answers   MCN Solutions,


19. Display all clients whose name begins with the letter J or contains the letter M anywhere or contains E as the third letter.

2 Answers   Wipro,


What is Database Trigger ?

1 Answers  


What is SYSTEM tablespace and When is it Created?

2 Answers  


Other than making use of the statspack utility, what would you check when you are monitoring or running a health check on an Oracle 8i or 9i database?

0 Answers  


How do I use unicode codesets with the weblogic jdriver for oracle driver?

0 Answers  


Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)