今天遇到了一个更新LOOKUP的需求。需求很简单,将字段MEANING的值更新到字段DESCRIPTION上。从网上查找用到FND_LOOKUP_VALUES_PKG这个包。此包包括insert_row,update_row,translate_row等,网上也说此包不是标准的API,不过可以使用暂时没发现什么问题。很简单,附上我的代码:
- DECLARE
- CURSOR cur_lv
- IS
- SELECT *
- FROM fnd_lookup_values
- WHERE lookup_type = 'XXX' --XXX : lookup_type name.
- AND LANGUAGE = 'US';
- BEGIN
- FOR rec_lv IN cur_lv
- LOOP
- fnd_lookup_values_pkg.update_row (x_lookup_type => rec_lv.lookup_type,
- x_security_group_id => rec_lv.security_group_id,
- x_view_application_id => rec_lv.view_application_id,
- x_lookup_code => rec_lv.lookup_code,
- x_tag => rec_lv.tag,
- x_attribute_category => rec_lv.attribute_category,
- x_attribute1 => rec_lv.attribute1,
- x_attribute2 => rec_lv.attribute2,
- x_attribute3 => rec_lv.attribute3,
- x_attribute4 => rec_lv.attribute4,
- x_enabled_flag => rec_lv.enabled_flag,
- x_start_date_active => rec_lv.start_date_active,
- x_end_date_active => rec_lv.end_date_active,
- x_territory_code => rec_lv.territory_code,
- x_attribute5 => rec_lv.attribute5,
- x_attribute6 => rec_lv.attribute6,
- x_attribute7 => rec_lv.attribute7,
- x_attribute8 => rec_lv.attribute8,
- x_attribute9 => rec_lv.attribute9,
- x_attribute10 => rec_lv.attribute10,
- x_attribute11 => rec_lv.attribute11,
- x_attribute12 => rec_lv.attribute12,
- x_attribute13 => rec_lv.attribute13,
- x_attribute14 => rec_lv.attribute14,
- x_attribute15 => rec_lv.attribute15,
- x_meaning => rec_lv.meaning,
- x_description => rec_lv.meaning, --update
- x_last_update_date => rec_lv.last_update_date,
- x_last_updated_by => rec_lv.last_updated_by,
- x_last_update_login => rec_lv.last_update_login
- );
- END LOOP;
- EXCEPTION
- WHEN OTHERS
- THEN
- DBMS_OUTPUT.put_line (SQLERRM);
- END;
阅读(5121) | 评论(0) | 转发(0) |