CREATE OR REPLACE TRIGGER CASIC_METADATACONTENTIT
BEFORE INSERT ON CASIC_METADATACONTENT
FOR EACH ROW

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