sqloracle-databaseplsqltriggersextract-error-message

Error(10,4): PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: end not pragma final


create or replace TRIGGER "VALIDATE_DOA_DOD" BEFORE UPDATE ON IN_PATIENT 
FOR EACH ROW
BEGIN
  IF :NEW.DOD < :OLD.DOA THEN


    enter code here


 RAISE EX_INVALID_DOD;
  END IF;

  EXCEPTIION
    WHEN EX_INVALID_DOD THEN
      dbms_output.put_line('Date Of Discharge must be greater or equal to Date of Admition');

END;

Solution

    1. replace the 'enter code here' with something meaningful, or remove it
    2. edit EXCEPTIION into EXCEPTION
    3. declare your exception EX_INVALID_DOD

    So:

    create or replace TRIGGER "VALIDATE_DOA_DOD" BEFORE UPDATE ON IN_PATIENT 
    FOR EACH ROW
    declare
        EX_INVALID_DOD exception;
    BEGIN
      IF :NEW.DOD < :OLD.DOA THEN
    
    
         --enter code here
    
    
         RAISE EX_INVALID_DOD;
      END IF;
    
      EXCEPTION
        WHEN EX_INVALID_DOD THEN
          dbms_output.put_line('Date Of Discharge must be greater or equal to Date of Admition');
    
    END;