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

Home -> Community -> Usenet -> c.d.o.misc -> Triggers seem to be compiled only randomly

Triggers seem to be compiled only randomly

From: Andreas Mosmann <keineemails_at_gmx.de>
Date: Tue, 02 Aug 2005 17:44:34 +0200
Message-ID: <1122997474.82@user.newsoffice.de>


Hi,

there is a script that generates triggers.[2]

The problem is the following behavior: both [1] scripts are created by the same script, same schema, nearly same trigger body, same tables, but:
in the first script I had to insert the schema before the table name (if not there were no way to compile) and the second worked fine without changes. All things are similar to equal, the only difference are the detail table and of course the trigger name, but in the first script I had to insert schema, the second works without. Is there any explaination (I can reproduce this many times, there are some similar scripts with same differences)

I work on Oracle 9.2i, OS is WinXP

Andreas

[1]

CREATE TRIGGER SABISDAT.itzVerarbeitungsSchlUC0 BEFORE UPDATE

ON SABISDAT.tzVerarbeitungsSchl
   ^^^^^^^^^

FOR EACH ROW
BEGIN
  IF :NEW.cID <> :OLD.cID THEN
    UPDATE
      tbBuchungen
    SET
      cIDVerarb = :NEW.cID
    WHERE
      cIDVerarb = :OLD.cID;
  END IF;
END; CREATE TRIGGER SABISDAT.itzVerarbeitungsSchlUC1 BEFORE UPDATE
ON tzVerarbeitungsSchl
FOR EACH ROW
BEGIN
  IF :NEW.cID <> :OLD.cID THEN
    UPDATE
      tbBuchungsVorlagen
    SET
      cIDVerarb = :NEW.cID
    WHERE
      cIDVerarb = :OLD.cID;
  END IF;
END;
[2]

In that case the triggers controls, that if the primary key of the mastertable changes the all foreign keys of detailtable are changed. (I guess it will not work, because a constraint will prevent the update, but this is not my actual problem)
-- 
wenn email, dann AndreasMosmann <bei> web <punkt> de
Received on Tue Aug 02 2005 - 10:44:34 CDT

Original text of this message

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