wizardofsilence
IS-IT--Management
Q- ensure that event records can not be deleted if the "evdate" is not later than the current date
I created the following trigger for this matter.
CREATE OR REPLACE TRIGGER TRIGTEST3
BEFORE DELETE OR UPDATE OF evdate ON event
FOR EACH ROW
BEGIN
IF :OLD.EVDATE >= 'SYSDATE' THEN
RAISE_APPLICATION_ERROR(-20101,'OUT OF RANGE');
--ELSE
-- DELETE FROM cusarrive c , event e where e.eventID = c.eventID AND evdate = evdate;
--delete from event where evdate = evdate;
END IF;
END;
delete from event where eventID = 004;
trigger executes but when deleting..
it gives:
ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at "TEST.TRIGTEST3", line 2
ORA-04088: error during execution of trigger 'TEST.TRIGTEST3'
1. delete from event where eventID = 004;
.....
I want to delete data using the given scenario and the code should delete the related (cusarrive) table's data also..
thanks for the help in advance.
GKD...
I created the following trigger for this matter.
CREATE OR REPLACE TRIGGER TRIGTEST3
BEFORE DELETE OR UPDATE OF evdate ON event
FOR EACH ROW
BEGIN
IF :OLD.EVDATE >= 'SYSDATE' THEN
RAISE_APPLICATION_ERROR(-20101,'OUT OF RANGE');
--ELSE
-- DELETE FROM cusarrive c , event e where e.eventID = c.eventID AND evdate = evdate;
--delete from event where evdate = evdate;
END IF;
END;
delete from event where eventID = 004;
trigger executes but when deleting..
it gives:
ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at "TEST.TRIGTEST3", line 2
ORA-04088: error during execution of trigger 'TEST.TRIGTEST3'
1. delete from event where eventID = 004;
.....
I want to delete data using the given scenario and the code should delete the related (cusarrive) table's data also..
thanks for the help in advance.
GKD...