insert into ies.T_NSI_UPDATE_XML(NsiUpdateID, XsdPath, XmlBulkPath)
select NsiUpdateID, XsdPath, XmlBulkPath
from ies.T_NSI_UPDATE
where XsdPath is not null or XmlBulkPath is not null;

update ies.T_NSI_UPDATE
set type_ = (select EntityID from vclib.T_ENTITIES where entname = 'NSI_UPDATE_XML' limit 1)
where XsdPath is not null or XmlBulkPath is not null;