CREATE OR REPLACE TRIGGER btinsert
BEFORE INSERT ON sample
BEGIN
IF (TO_CHAR(SYSDATE,'HH24:MI')
NOT BETWEEN ('08:00' AND '22:00') THEN
RAISE_APPLICATION_ERROR(-20500, 'you may insert'
||' into EMPLOYEES table only during '
||' normal business hours.');
END IF;
END;
but I’m getting an error:
ERROR at line 8: PLS-00103: Encountered the symbol “END”
6. RAISE_APPLICATION_ERROR(-20500, ‘you may insert’
7. ||’ into EMPLOYEES table only during ‘
8. ||’ normal business hours.’);
9. END IF;
10. END;
you have some missing brackets and excess ones too.