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

What are the Diff B/W Cursor and REF Cursor

3 Answers   CTS,


what are the 'mysql' command line arguments? : Sql dba

0 Answers  


<<labele>> declare a=10 b=20, begin some statements declare a=30 c=40 end; what is the A value in nested block?

1 Answers   ITC Infotech,


declare lowerl number:= 1; upperl number:= 3; num varchar2(10); begin for i into lowerl..upperl loop num:=num||to_char(lowerl); if i=3 then upperl:=5; end loop; message(num); What will be the output ?

3 Answers   Oracle,


How to get each name only once from an employee table?

0 Answers  






Is there a way to automate sql execution from the command-line, batch job or shell script?

0 Answers  


How to create a menu in sqlplus or pl/sql?

0 Answers  


Which are the different case manipulation functions in sql?

0 Answers  


What are the two parts of a procedure ?

6 Answers   Hi Caliber IT,


What is the difference between cross join and natural join?

0 Answers  


What is dynamic query?

0 Answers  


Why do we create views in sql?

0 Answers  


Categories