Chinaunix首页 | 论坛 | 博客
  • 博客访问: 48790
  • 博文数量: 3
  • 博客积分: 110
  • 博客等级: 民兵
  • 技术积分: 66
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-04 17:51
文章分类

全部博文(3)

文章存档

2013年(2)

2012年(1)

我的朋友

分类: Oracle

2012-12-24 20:52:48

  今天遇到了一个更新LOOKUP的需求。需求很简单,将字段MEANING的值更新到字段DESCRIPTION上。从网上查找用到FND_LOOKUP_VALUES_PKG这个包。此包包括insert_row,update_row,translate_row等,网上也说此包不是标准的API,不过可以使用暂时没发现什么问题。很简单,附上我的代码:

点击(此处)折叠或打开

  1. DECLARE
  2.    CURSOR cur_lv
  3.    IS
  4.       SELECT *
  5.       FROM fnd_lookup_values
  6.       WHERE lookup_type = 'XXX' --XXX : lookup_type name.

  7.       AND LANGUAGE = 'US';
  8. BEGIN
  9.    FOR rec_lv IN cur_lv
  10.    LOOP
  11.       fnd_lookup_values_pkg.update_row (x_lookup_type => rec_lv.lookup_type,
  12.                                         x_security_group_id => rec_lv.security_group_id,
  13.                                         x_view_application_id => rec_lv.view_application_id,
  14.                                         x_lookup_code => rec_lv.lookup_code,
  15.                                         x_tag => rec_lv.tag,
  16.                                         x_attribute_category => rec_lv.attribute_category,
  17.                                         x_attribute1 => rec_lv.attribute1,
  18.                                         x_attribute2 => rec_lv.attribute2,
  19.                                         x_attribute3 => rec_lv.attribute3,
  20.                                         x_attribute4 => rec_lv.attribute4,
  21.                                         x_enabled_flag => rec_lv.enabled_flag,
  22.                                         x_start_date_active => rec_lv.start_date_active,
  23.                                         x_end_date_active => rec_lv.end_date_active,
  24.                                         x_territory_code => rec_lv.territory_code,
  25.                                         x_attribute5 => rec_lv.attribute5,
  26.                                         x_attribute6 => rec_lv.attribute6,
  27.                                         x_attribute7 => rec_lv.attribute7,
  28.                                         x_attribute8 => rec_lv.attribute8,
  29.                                         x_attribute9 => rec_lv.attribute9,
  30.                                         x_attribute10 => rec_lv.attribute10,
  31.                                         x_attribute11 => rec_lv.attribute11,
  32.                                         x_attribute12 => rec_lv.attribute12,
  33.                                         x_attribute13 => rec_lv.attribute13,
  34.                                         x_attribute14 => rec_lv.attribute14,
  35.                                         x_attribute15 => rec_lv.attribute15,
  36.                                         x_meaning => rec_lv.meaning,
  37.                                         x_description => rec_lv.meaning, --update

  38.                                         x_last_update_date => rec_lv.last_update_date,
  39.                                         x_last_updated_by => rec_lv.last_updated_by,
  40.                                         x_last_update_login => rec_lv.last_update_login
  41.                                        );
  42.    END LOOP;
  43. EXCEPTION
  44.    WHEN OTHERS
  45.    THEN
  46.       DBMS_OUTPUT.put_line (SQLERRM);
  47. END;

阅读(5062) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:DOS批处理做的文件上传(一)

给主人留下些什么吧!~~