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 ?    6 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 7 No

Post New Answer

More SQL PLSQL Interview Questions

There are 5 records in a table and we have implemented two triggers that are :pre_query and post_query how many times these triggers will fire.

2 Answers   Maruti Suzuki,


What are the uses of sysdate and user keywords?

0 Answers  


Explain the working of primary key?

0 Answers  


what are the different types of joins?

4 Answers   Choice Solutions,


What is prepared statement in sql?

0 Answers  






how to insert the records in particular position

1 Answers  


When you have to use a default "rollback to" savepoint of plvlog?

0 Answers  


What is the main reason behind using an index?

0 Answers  


What is sql clause?

0 Answers  


Is left join inner or outer by default?

0 Answers  


when a procedure /package is getting invalidated?

4 Answers   TCS,


Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?

0 Answers  


Categories