CREATE SEQUENCE PRESCRIPTION_seq;

CREATE OR REPLACE TRIGGER PRESCRIPTION_seq_trg
BEFORE INSERT ON PRESCRIPTION
FOR EACH ROW
BEGIN
    select REFERENCES_seq INTO :NEW.PRESCRIPTION_ID FROM PRESCRIPTION
END;