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

Home -> Community -> Mailing Lists -> Oracle-L -> Database Trigger Confusion

Database Trigger Confusion

From: Yexley Robert D SSgt AFIT/SCA <Robert.Yexley_at_afit.edu>
Date: Thu, 24 May 2001 09:43:55 -0700
Message-ID: <F001.0030D9BF.20010524095116@fatcity.com>

I have created a trigger on a table to write information to a history table, and I've run into some behavior that's confusing me...some clarification would be greatly appreciated.

My trigger code is as follows:

CREATE OR REPLACE TRIGGER endb.budget_total_amt_hist_trg

        BEFORE UPDATE of total_amt_auth, expiration on endb.budget
        FOR EACH ROW
        BEGIN
                <code_to_rollover_data_to_history_table>
        END;

Now my confusion lies in the fact that the trigger is supposed to fire ONLY when either the total_amt_auth column OR the expiration column gets updated. Now, of course it works fine when we update either of those columns. But the problem/confusion is why is it also firing when we update other fields in the table also?? If we update any column other than those two the trigger still fires. What am I doing wrong or missing/forgetting???

-::YEX::- Robert D. Yexley, SSgt
Air Force Institute of Technology
Applications Services Division (SCA)
Oracle DBA & Programmer
<)))><

robert.yexley_at_afit.edu
DSN - 785-6565 x-4268
Commercial - (937) 255-6565 x-4268



"God who gave us life gave us liberty.
Can the liberties of a nation be secure
when we have removed a conviction
that these liberties are a gift of God?
Indeed I tremble for my country when
I reflect that God is just, that his
justice cannot sleep forever."
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Yexley Robert D SSgt AFIT/SCA
  INET: Robert.Yexley_at_afit.edu

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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 Thu May 24 2001 - 11:43:55 CDT

Original text of this message

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