How to perform a loop through all tables in pl/sql?




Answers were Sorted based on User's Feedback



How to perform a loop through all tables in pl/sql?..

Answer / chandrakant rathod

We can get all tables for particular instance using below block .

SET SERVEROUTPUT ON;
begin
for rec in (select object_name from user_objects where object_type='TABLE')
loop
dbms_output.put_line('TABLE'||rec.object_name);
end loop;
end;
/

Is This Answer Correct ?    5 Yes 0 No

How to perform a loop through all tables in pl/sql?..

Answer / rahul name

We can use user_tables view of data dictionary.
create a cursor based on query
select * from user_tables and then use use this cursor
in for loop

Is This Answer Correct ?    3 Yes 4 No

How to perform a loop through all tables in pl/sql?..

Answer / highness

I got a lot of definitions for this but i thing this is right

A compiled plsql procedure
stands for a stored procedure...

check out this

Is This Answer Correct ?    1 Yes 2 No




How to perform a loop through all tables in pl/sql?..

Answer / mahesh gulati

select * from sysobjects where type = 'u'

Is This Answer Correct ?    3 Yes 6 No

Post New Answer



More SQL PLSQL Interview Questions

What is correlated sub-query?

7 Answers   Oracle,


What is an implicit commit?

0 Answers  


what is the difference between a having clause and a where clause? : Sql dba

0 Answers  


How to call the function and Procedure in trigger?

3 Answers   IBM,


What is rownum?

0 Answers  






I want to display the employees who have joined in last two months. (It should be executed randomly means If I execute the query in March it should display Jan and Feb joined employees. Same query if i execute in Feb, 2007 it should display dec, 2006 and jan 2007 joined employees.

15 Answers   Wipro,


How will you distinguish a global variable with a local variable in pl/sql?

0 Answers  


What are the different sql languages?

0 Answers  


What is normalisation in sql?

0 Answers  


What do you mean by rowid?

0 Answers  


IF EMP HAS 2 ROWS,DEPT HAS 4 ROWS.WHATS THE RESULT OF SELECT * FROM EMP,DEPT;

1 Answers  


Differentiate between syntax and runtime errors.

0 Answers  






Categories