Home » SQL & PL/SQL » SQL & PL/SQL » Trigger problem!!!
Trigger problem!!! [message #37914] Wed, 06 March 2002 03:33 Go to next message
Sheryl
Messages: 6
Registered: November 2001
Junior Member
Hello!
I encoutered the following problem : I have the following trigger :

create or replace trigger trig_date
before insert or update on spot_cost
for each row
begin

if :new.Valid_From > :new.Valid_to then
raise_Application_error(-20099,'Valid_To should be greater than Valid_From');
end if;
end;/

When an insertion such as the following occurs :
INSERT INTO spot_cost
(Show_name, Duration, Cost, Valid_From,Valid_To, Upd_by)
values ('60 minutes', '15', 2000,to_date('01-11-9999','DD-MM-YYYY '), to_date('02-12-2000','DD-MM-YYYY '), USER );

the trigger returns the following results:

ORA-20099: Valid_To should be greater than Valid_From
ORA-06512: at "GREEN.TRIG_DATE", line 4
ORA-04088: error during execution of trigger 'GREEN.TRIG_DATE'

The first error(ORA-20099) is ok, as I have specified it.What about the other two error messages;
What should I do;
thank you very much in advance, is quite urgent and I would appreciate any help
Re: Trigger problem!!! [message #37915 is a reply to message #37914] Wed, 06 March 2002 04:10 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
see my previous posting in NEWBIES Board
Previous Topic: What does USERENV do?
Next Topic: Unique Constraint
Goto Forum:
  


Current Time: Sat Apr 20 02:13:35 CDT 2024