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

Home -> Community -> Usenet -> c.d.o.server -> Q: Evaluation of :old in triggers

Q: Evaluation of :old in triggers

From: Ivan Bajon <bajon_at_nospam@worldonline.dk>
Date: Wed, 18 Apr 2001 13:45:52 +0200
Message-ID: <9bjula$ab$1@news.inet.tele.dk>

Hi folks

(8.1.6)

I have a rather large trigger along the lines of

begin
<snip>

  if updating('COL1') then my_function('COL1', :old.COL1, :new.COL1) end if;
  if updating('COL2') then my_function('COL2', :old.COL2, :new.COL2) end if;
  if updating('COL3') then my_function('COL3', :old.COL3, :new.COL3) end if;
  ...
  if updating('COL100') then my_function('COL100', :old.COL100, :new.COL100) end if;
<snip>

end;

My questions are:

  1. When are :old and :new evaluted?
  2. Do they all get evaluated at once or only at reference?
  3. Is there some kind of table lookup involved in evaluating them or are the old and new values stored in an internal current record buffer or at trigger execution time for fast access?
  4. How does Oracle actually figure out that updating() = true?

As you may suspect, my trigger runs slowly and I'm hunting down "unnecessary" overhead time.

Thanks in advance,
Ivan Bajon, ocp Received on Wed Apr 18 2001 - 06:45:52 CDT

Original text of this message

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