Home » SQL & PL/SQL » SQL & PL/SQL » Raise _application_error
Raise _application_error [message #36494] Fri, 30 November 2001 02:56 Go to next message
Messages: 6
Registered: November 2001
Junior Member
How do I use a raise_application_error in a trigger,
I've got this but it gives an error:

create or replace trigger trig_date
before insert or update on spot_cost
for each row
if :new.Valid_From > :new.Valid_to then

raise_Application_error(-20001,'Valid_to should be greater than Valid_from');
end if;

I get the error:
ERROR at line 2:
ORA-20001: Valid_to should be greater than
ORA-06512: at "MARIA.TRIG_DATE", line 5
ORA-04088: error during execution of trigger 'MARIA.TRIG_DATE'

when I do an insert that is not allowed by the system.
I have read what those errors mean, but I can't understand what to do
Any help is valuable

Re: Raise _application_error [message #36496 is a reply to message #36494] Fri, 30 November 2001 03:26 Go to previous message
Rob Baillie
Messages: 33
Registered: November 2001
See my reply to the previous message on this board:


Previous Topic: Error messages
Next Topic: DataBase Trigger wrt the SYSDATE
Goto Forum:

Current Time: Thu May 23 02:08:37 CDT 2024