码迷,mamicode.com
首页 > 其他好文 > 详细

更新客户信息

时间:2014-11-25 23:34:15      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:blog   ar   for   2014   art   log   ad   ef   as   

DECLARE
   CURSOR cur_h IS
      SELECT h.*
        FROM ar_customers h
       WHERE h.customer_name  /*'—XD';*/
             LIKE '%—XD';

   p_customer_rec  cux_ar_cust_accounts_v%ROWTYPE;
   l_return_status VARCHAR2(30);
   l_msg_count     NUMBER;
   l_msg_data      VARCHAR2(3000);
   l_party_id      NUMBER;
   l_name          VARCHAR2(3000);
   /*FROM CUX_AR_CUSTOMERS_BILL_ALL*/

BEGIN

   FOR rec_h IN cur_h LOOP
   
      SELECT REPLACE(rec_h.customer_name, '—', '-') INTO l_name FROM dual;
   
      p_customer_rec.party_name := l_name; -- 客户名称
      /*p_customer_rec.party_number:=;
      p_customer_rec.tax_reference:=; -- 纳税登记编号
      p_customer_rec.account_number:=; --客户账号
           -- l_cust_account_rec.customer_type       := 'R'; --p_customer_rec.; -- 账户类型:'R' 外部
      p_customer_rec.customer_class_code:=; -- 账户分类: 'FWDW' 服务单位
      p_customer_rec.sales_channel_code:=; -- 销售渠道*/
      -- l_cust_account_rec.created_by_module       := c_created_by_module;
      -- l_cust_account_rec.tax_header_level_flag   := rec.tax_header_level_flag; ----add by Jake.Yu@2012-11-29---
      -- l_cust_account_rec.tax_rounding_rule       := rec.tax_rounding_rule; ----add by Jake.Yu@2012-11-29---
   
      p_customer_rec.cust_account_id := rec_h.customer_id;
   
      SELECT l.party_id
        INTO l_party_id
        FROM hz_cust_accounts l
       WHERE l.cust_account_id = rec_h.customer_id;
   
      p_customer_rec.party_id := l_party_id;
      /* p_customer_rec.category_code :=; -- 客户类别
      p_customer_rec.related_party :=; -- 关联方标识
      p_customer_rec.party_number:=;*/
   
      cux_ar_customer_infor_pkg.sys_update_customer(p_customer_rec  => p_customer_rec,
                                                    x_return_status => l_return_status,
                                                    x_msg_count     => l_msg_count,
                                                    x_msg_data      => l_msg_data);
   
   END LOOP; --FOR rec_h IN cur_h LOOP

END;

/*SELECT * FROM HZ_PARTIES;
*/
/*SELECT *FROM CUX_AR_CUSTOMERS_BILL_ALL;

SELECT * FROM CUX_AR_CUST_ACCOUNTS_ALL;
*/

/*SELECT * FROM AR_CUSTOMERS l WHERE l.CUSTOMER_NAME = '乌—XD';*/

更新客户信息

标签:blog   ar   for   2014   art   log   ad   ef   as   

原文地址:http://blog.csdn.net/cai_xingyun/article/details/41493493

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!