Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using dba views inside procedures

Dba_SureshSJun 28 2010 — edited Jun 28 2010
I am trying to write a proc for dropping old partitions.

Can we use dba views(dba_tab_partitions) inside a procedure.

create or replace procedure test_Purge as
part_name varchar2(30);
begin
select PARTITION_NAME into part_name from dba_tab_partitions where TABLE_NAME like 'DET_NOTES' and PARTITION_POSITION=1;
dbms_output.put_line('Partition that will be deleted is :'|| part_name);
execute immediate 'alter table DET_NOTES drop partition'|| part_name ||' update global indexes';
end;
/


Will this work?

Thanks in advance.
This post has been answered by Beco on Jun 28 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 26 2010
Added on Jun 28 2010
12 comments
1,901 views