Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Database Trigger not fireing In Delete Mode

Re: Database Trigger not fireing In Delete Mode

From: <Chaim.Katz_at_Completions.Bombardier.com>
Date: Fri, 11 Oct 2002 08:19:19 -0800
Message-ID: <F001.004E6E5E.20021011081919@fatcity.com>

Naba,

I think you need something like this
CREATE OR REPLACE TRIGGER triggername
AFTER INSERT OR UPDATE OR DELETE
ON tablename
FOR EACH ROW
WHEN (NVL(new.fldname1,old.fldname1)is not null and

      NVL(new.fldname2,old.fldname2)is not null) DECLARE
BEGIN
  processing goes here
END; hth,
Chaim

njneog_at_oil.asm.nic.in (N J Neog)@fatcity.com on 10/11/2002 12:13:26 AM

Please respond to ORACLE-L_at_fatcity.com

Sent by: root_at_fatcity.com

To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc:

Hi all,

I have  row level table trigger  to fire on DELETE or INSERT or UPDATE Mode .
It has to fire on certain condition, meaning I have a WHEN condition also.

WHEN Condition is like :
       when ( NEW.CR_ACCOUNT is not null and   NEW.CHQ_DT is not null )

Since, in DELETE mode NEW value contains null  ,  it does not fire.

This Problem would have solved if could write WHEN Condition as

       when  ((INSERTING or UPDATING) and NEW.CR_ACCOUNT is not null
                   and   NEW.CHQ_DT is not null ) OR
                 (DELETING and OLD.CR_ACCOUNT is not null  and   OLD.CHQ_DT
is not null )

But in WHEN condition one can not write INSERTING or UPDATING.

How do i go about it ? Any round about way

Thanks & Regards.

Naba

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: Chaim.Katz_at_Completions.Bombardier.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Oct 11 2002 - 11:19:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US