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 ?    3 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 5 No

Post New Answer



More SQL PLSQL Interview Questions

Is it possible to use LONG columns in WHERE clause or ORDER BY?

3 Answers  


What is materialised View?

2 Answers   IBM,


25.67,-1 Trunc = 20 Round= 30 HOW????

2 Answers   Karrox,


How to return more than one value from a function?

11 Answers   Satyam,


what is meant by DML?

5 Answers   HCL,






what is the difference between trigger and constraint?

3 Answers   HSBC,


what is the difference between pragma exception_init and raise_application_error

1 Answers   Aetins, State Street,


write a query to delete similar records in different tables with same structure

4 Answers  


Write a query to find the name of employees those who have joined on Monday.(based on column hire_date)

12 Answers   Satyam,


wtite down triggr not any entry on Sunday

2 Answers   NIT,


is it mandatory to select all the column in a view then what columns should be selected

2 Answers  


full outer join syntax

5 Answers  






Categories