DECLARE
l_rowid ROWID;
cursor cur is
select pvs.SEGMENT1 vendor_code, pvs.VENDOR_NAME
from po_vendors pvs
where not exists (select 1
from fnd_lookup_values_vl flvv
where flvv.LOOKUP_TYPE = 'CUX_PO_CONCENTRATE_VENDOR'
and flvv.LOOKUP_CODE = pvs.SEGMENT1);
-- and pvs.SEGMENT1 in ('E133','E196');
BEGIN
for v in cur loop
--dbms_output.put_line('before_l_rowid='||l_rowid);
fnd_lookup_values_pkg.insert_row(x_rowid => l_rowid,
x_lookup_type => 'CUX_PO_CONCENTRATE_VENDOR' /*类型*/,
x_view_application_id => 3,
x_lookup_code => v.vendor_code, --'XXX' /*代码*/,
x_tag => '',
x_attribute_category => '',
x_attribute1 => '',
x_attribute2 => '',
x_attribute3 => '',
x_attribute4 => '',
x_enabled_flag => 'Y' /*启用*/,
x_start_date_active => SYSDATE /*有效期自*/,
x_end_date_active => '' /*有效期至*/,
x_territory_code => '',
x_attribute5 => '',
x_attribute6 => '',
x_attribute7 => '',
x_attribute8 => '',
x_attribute9 => '',
x_attribute10 => '',
x_attribute11 => '',
x_attribute12 => '',
x_attribute13 => '',
x_attribute14 => '',
x_attribute15 => '',
x_meaning => v.vendor_code, --'XXX' /*含义*/,
x_description => v.VENDOR_NAME, --'YYYYYY' /*说明*/,
x_creation_date => SYSDATE,
x_created_by => 0,
x_last_update_date => SYSDATE,
x_last_updated_by => 0,
x_last_update_login => 0);
--dbms_output.put_line('after_l_rowid='||l_rowid);
COMMIT;
end loop;
END;