Following the syntaxes to create Sequence & Triggers
To Create Sequence:
===================
CREATE SEQUENCE "SchemaName"."Table1_LOG_SEQ" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1
To Create Trigger:
==================
CREATE TRIGGER SchemaName.Table1_LOG_TRIGGER
BEFORE INSERT ON SchemaName.Table1_LOG
FOR EACH ROW
BEGIN
SELECT Table_LOG_SEQ.NEXTVAL INTO :NEW.ID FROM DUAL;
END;
No comments:
Post a Comment