Fixed ORACLE DB script issue

revert-70aa11f8
harshanl 8 years ago
parent f3aefcca77
commit 556c82b2e8

@ -7,16 +7,16 @@ CREATE TABLE DM_DEVICE_TYPE (
)
/
-- Generate ID using sequence and trigger
CREATE SEQUENCE DM_DEVICE_TYPE_seq START WITH 1 INCREMENT BY 1 NOCACHE
CREATE SEQUENCE DM_DEVICE_TYPE_id_seq START WITH 1 INCREMENT BY 1 NOCACHE
/
CREATE OR REPLACE TRIGGER DM_DEVICE_TYPE_seq_tr
CREATE OR REPLACE TRIGGER DM_DEVICE_TYPE_id_seq_tr
BEFORE INSERT
ON DM_DEVICE_TYPE
REFERENCING NEW AS NEW
FOR EACH ROW
WHEN (NEW.ID IS NULL)
BEGIN
SELECT DM_DEVICE_TYPE_seq.NEXTVAL INTO :NEW.ID FROM DUAL;
SELECT DM_DEVICE_TYPE_id_seq.NEXTVAL INTO :NEW.ID FROM DUAL;
END;
/

Loading…
Cancel
Save