CREATE OR REPLACE TRIGGER trg_ssn
BEFORE INSERT ON Patient
FOR EACH ROW
BEGIN
If (:new.ssn) is null then
IF sysdate - :new.dob < 730 THEN
RAISE_APPLICATION_ERROR (-20500, 'Patient must be');
END IF;
end if;
end trg_ssn;
/
show errors;
________________________
you use the :new operator and :old operator. Close to the same as SQL Server.
Do a search on the web for those two operators.
Sal
|