|
|
|
@ -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;
|
|
|
|
|
/
|
|
|
|
|
|
|
|
|
|