Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Warning while creating trigger..
Hi,
I am trying to create the following trigger on Oracle 8 database. The database and the client are running on WinNT 4.0.
I need to compare dates in the trigger. What is the right way to do this? The first trigger works but the second listed does not. The second generates a warning "MGR-00073 TRIGGER created with compilation errors".
# Works without warnings
CREATE OR REPLACE TRIGGER "USER".TRG_TEST
AFTER INSERT ON "USER"."TEST2"
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
OLD_DATE DATE;
BEGIN
SELECT FDATETIME INTO OLD_DATE FROM TEST WHERE FID = :NEW.FID;
UPDATE TEST SET FDATETIME = :NEW.FDATETIME WHERE FID = :NEW.FID;
END;
# Generates a warning
CREATE OR REPLACE TRIGGER "USER".TRG_TEST
AFTER INSERT ON "USER"."TEST2"
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
DECLARE
OLD_DATE DATE;
BEGIN
SELECT FDATETIME INTO OLD_DATE FROM TEST WHERE FID = :NEW.FID;
IF OLD_DATE < :NEW.FDATETIME THEN
UPDATE TEST SET FDATETIME = :NEW.FDATETIME WHERE FID = :NEW.FID;
END IF;
END;
I tried looking up the error code but could not find MGR-00073 anywhere in the
documentation. Anybody know what the problem could be? Any pointers are much
appreciated. Thanks and have a nice day.
Sincerely,
Broker2000
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Mar 17 1999 - 16:15:38 CST