trying to figure out a truncate trigger issue

  • From: TESTAJ3@xxxxxxxxxxxxxx
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Wed, 13 Jan 2010 09:58:18 -0500

I need to be able to run a "alter table truncate partition" but NOT a 
truncate table.

I can't seem to figure out how to separate those 2 commands, it appears to 
a schema level trigger for truncate as they are the same.

test code below:

thanks, joe

------------------------------------------
drop table x1_test;

create table x1_test
( z date)
partition by range (z)
(partition part_1999 values less than 
(to_date('01-jan-2000','dd-mon-yyyy')),
partition part_2000 values less than 
(to_date('01-jan-2001','dd-mon-yyyy'))
);


create or replace trigger x1_test_trig
before truncate on schema

begin
  raise_application_error('-20001','No truncate allowed');
end;
/


alter table x1_test truncate partition part_1999;

_______________________________________
Joe Testa, Oracle Certified Professional 
Senior Engineering & Administration Lead
(Work) 614-677-1668
(Cell) 614-312-6715

Interested in helping out your marriage?
Ask me about "Weekend to Remember"
Feb 12-Feb 14, 2010, Valentine's Day Weekend
in Akron, OH

Other related posts: