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

In a package if we have 10 procedures or functions,How to know which will execute first?

1 Answers   Sollet Soft,


What is the use of procedures?

0 Answers  


What is dense_rank?

0 Answers  


What is the example of procedure?

0 Answers  


Can there be more than one function with a similar name in a pl/sql block?

0 Answers  






Hello All, Could any well write a query for the following scenario. Account(table name) No Name Amount 1 ABCD 2000.00 2 DEFG -2000.00 3 GHIJ 3000.50 4 JKLM 4000.00 5 MNOP 6000.00 O/p Should be in this format No Name Credit Debit 1 ABCD 2000.00 0 2 DEFG 0 -2000.00 3 GHIJ 3000.50 4 JKLM 0 -4000.00 5 MNOP 6000.00 o could any one give appropriate query for this Thnks in Advance Suneel Reddy

6 Answers   Target,


How pl/sql source code can be protected?

3 Answers  


What is pivot in sql?

0 Answers  


What is normalization in a database?

0 Answers  


What is rollback?

0 Answers  


how to shutdown mysql server? : Sql dba

0 Answers  


How do I kill a query in postgresql?

0 Answers  


Categories