Raise _application_error [message #36494] |
Fri, 30 November 2001 02:56  |
Sheryl
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
begin
if :new.Valid_From > :new.Valid_to then
raise_Application_error(-20001,'Valid_to should be greater than Valid_from');
end if;
end;
/
I get the error:
ERROR at line 2:
ORA-20001: Valid_to should be greater than
Valid_from
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
----------------------------------------------------------------------
|
|
|
|