CREATE OR REPLACE TRIGGER CASIC_METADATALAYERIT
BEFORE INSERT ON CASIC_METADATALAYER
FOR EACH ROW

when (NEW.LAYERID IS NULL)
BEGIN
    SELECT CASIC_METADATALAYERIS.NEXTVAL INTO:NEW.LAYERID FROM DUAL;
    END;
