Connecting Tech Pros Worldwide Help | Site Map

How to disable trigger as soon as it got triggered.

Newbie
 
Join Date: Sep 2008
Posts: 4
#1: Feb 24 '09
I want to disable a trigger as soon as it got triggered. But dont know how to do this.

Could anyone please help me?

Thanks,
sanjaya
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,500
#2: Feb 24 '09

re: How to disable trigger as soon as it got triggered.


what is the triggering event ?
Newbie
 
Join Date: Sep 2008
Posts: 4
#3: Feb 24 '09

re: How to disable trigger as soon as it got triggered.


Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE temp_tab1(id_         VARCHAR2(20));
  2. CREATE TABLE temp_tab2(table_name_ VARCHAR2(20), accessed_date_  DATE);
  3.  
  4. CREATE OR REPLACE TRIGGER temp_tab1_trigger 
  5. BEFORE INSERT OR DELETE OR UPDATE ON temp_tab1 
  6. BEGIN
  7.      DBMS_OUTPUT.put_line('Temptab1 is updated');
  8.      INSERT INTO temp_tab2 VALUES ('temp_tab1',SYSDATE);
  9. END;
  10. /

I want to store the update time of temp_tab1 in temp_tab2 and immediately DISABLE temp_tab1_trigger
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,500
#4: Feb 24 '09

re: How to disable trigger as soon as it got triggered.


try the following link, will work in 11g

link
Member
 
Join Date: Sep 2007
Posts: 55
#5: Mar 10 '09

re: How to disable trigger as soon as it got triggered.


Hi,
Can we call a procedure that would call a disable trigger command ?
Is is a posible solution for this question.
If not, kindly explain?
Regards
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,500
#6: Mar 10 '09

re: How to disable trigger as soon as it got triggered.


That will cause the session to hang , because you can't disable a trigger while it is still executing.
Reply

Tags
disable, trigger