Fixed ORACLE DB script issue

4.x.x
harshanl 8 years ago
parent f3aefcca77
commit 556c82b2e8

@ -7,16 +7,16 @@ CREATE TABLE DM_DEVICE_TYPE (
) )
/ /
-- Generate ID using sequence and trigger -- 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 BEFORE INSERT
ON DM_DEVICE_TYPE ON DM_DEVICE_TYPE
REFERENCING NEW AS NEW REFERENCING NEW AS NEW
FOR EACH ROW FOR EACH ROW
WHEN (NEW.ID IS NULL) WHEN (NEW.ID IS NULL)
BEGIN 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; END;
/ /

Loading…
Cancel
Save