CREATE OR REPLACE TRIGGER TR_report_multiprepay_base
BEFORE INSERT ON tbl_report_multiprepay_base
REFERENCING FOR EACH ROW
DECLARE
BEGIN -- executable part starts here
IF (:NEW.pk IS NULL OR :NEW.pk = 0)
THEN
BEGIN
SELECT SEQ_REPORT_PUBLIC.NEXTVAL
INTO :NEW.pk
FROM DUAL;
END;
END IF;
END;
-- Create sequence
create sequence SEQ_REPORT_PUBLIC
minvalue 1
maxvalue 9999999999999999999999999999
start with 11864481
increment by 1
cache 20
order;
Oracle create trigger and sequence
最新推荐文章于 2024-10-30 15:59:27 发布