wizardofsilence
IS-IT--Management
I need to make a trigger which generates an error when value 'AUGUST' is entered as evdata in event.
Q- ensure that event cannot be run in the month of AUGUST.
I created the following trigger but the rows can be entered which include 'AUGUST' as data.
create or replace trigger trigtest
BEFORE INSERT OR UPDATE OF evdate ON event
FOR EACH ROW
BEGIN
IF TO_CHARNEW.evdate,'MONTH') = 'AUGUST' THEN
RAISE_APPLICATION_ERROR(-20101,'OUT OF RANGE');
END IF;
END;
INSERT INTO Event VALUES(005,'11-AUG-2012','18:00',21,9003); -- this value can be entered.
Thanks alt
GKD
Q- ensure that event cannot be run in the month of AUGUST.
I created the following trigger but the rows can be entered which include 'AUGUST' as data.
create or replace trigger trigtest
BEFORE INSERT OR UPDATE OF evdate ON event
FOR EACH ROW
BEGIN
IF TO_CHARNEW.evdate,'MONTH') = 'AUGUST' THEN
RAISE_APPLICATION_ERROR(-20101,'OUT OF RANGE');
END IF;
END;
INSERT INTO Event VALUES(005,'11-AUG-2012','18:00',21,9003); -- this value can be entered.
Thanks alt
GKD