How to perform a loop through all tables in pl/sql?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Answer / mahesh gulati
select * from sysobjects where type = 'u'
Is This Answer Correct ? | 3 Yes | 7 No |
What are the Diff B/W Cursor and REF Cursor
what are the 'mysql' command line arguments? : Sql dba
<<labele>> declare a=10 b=20, begin some statements declare a=30 c=40 end; what is the A value in nested block?
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 ?
How to get each name only once from an employee table?
Is there a way to automate sql execution from the command-line, batch job or shell script?
How to create a menu in sqlplus or pl/sql?
Which are the different case manipulation functions in sql?
What are the two parts of a procedure ?
What is the difference between cross join and natural join?
What is dynamic query?
Why do we create views in sql?