ALTERing triggers from within a trigger

From: E. Scott Stricker <stricsc_at_gdss.grumman.com>
Date: 1995/09/26
Message-ID: <stricsc-2609951047390001_at_mac146.grumman.com>#1/1


I'm trying to create the following trigger, and get compile errors on the ALTER TRIGGER lines. (Unsupported reserved word ALERT)

Does anyone know of another way to do this or what I am doing wrong here?

CREATE TRIGGER template_trigger AFTER INSERT OR DELETE on DISPLAYED_TEMPLATES FOR EACH ROW DECLARE    which_trigger VARCHAR2(38);
   which_table VARCHAR2(30);

   x                     NUMBER;

BEGIN    if DELETING then which_table := :old.table_name; end if;    if INSERTING then which_table := :new.table_name; end if;    which_trigger := which_table || '_TRIGGER';

   SELECT COUNT(*) INTO X FROM DISPLAYED_TEMPLATES WHERE table_name = which_table;

   if x = 0 then

      ALTER TRIGGER which_trigger DISABLE;    else

      ALTER TRIGGER which_trigger ENABLE;    end if;    

END template_trigger;

Thanks in advance.

-- 
Scott Stricker - stricsc_at_gdss.grumman.com
7600 Boston Blvd.
Springfield, VA 22153
(703)866-7423
Received on Tue Sep 26 1995 - 00:00:00 CET

Original text of this message