zoukankan      html  css  js  c++  java
  • Oracle For 循环,字符串拼接,查找

    --------------------------------------------------------------------------------xqp 20180209
       begin
         --找出有关这个配送单的相关记录,遍历
         --一个配送单号可能由多个看板组成,
         for curr in (select t.kanban_id,
                             t.plant_id,
                             t.item_id,
                             t.station_id,
                             t.kanban_group_qty,
                             t.ref_kb_dis_kid,
                             t.kanban_qty
                        from fy_ps_report_data t
                       where instr(concat(CONCAT(',', t.ref_kb_dis_kid), ','),
                                   concat(CONCAT(',', to_char(p_kid)), ',')) > 0) loop
           if curr.ref_kb_dis_kid = to_char(p_kid) then
             --当看板的配送单ID号跟P_kid相等时,直接改状态
             ln_message_id := fy_ps_pck.update_ps_report_data(p_kanban_id     => curr.kanban_id,
                                                              p_kanban_status => 'D');
             IF ln_message_id <> hcm_public_pck.g_success THEN
               --  RETURN ln_message_id;
               dbms_output.put_line('-------error1--------');
             END IF;
           else
             --当不相等时,看板生成多个配送单号,取这个物料生成的配送数量
             begin
               select t.apply_dis_qty
                 into ln_ps_qty
                 from fy_ps_line t
                where t.kid = p_kid
                  and t.item_id = curr.item_id
                  and t.plant_id = curr.plant_id;
             exception
               when others then
                 ln_ps_qty := 0;
             end;       
             ln_message_id := fy_ps_pck.update_ps_report_data(p_kanban_id  => curr.kanban_id,
                                                              p_kanban_qty => curr.kanban_qty -
                                                                              ln_ps_qty);
             IF ln_message_id <> hcm_public_pck.g_success THEN
               --  RETURN ln_message_id;
               dbms_output.put_line('----error2--------');
             END IF;
           end if;
         end loop;
       end;
    -------------------------------------------------------------------------------------
  • 相关阅读:
    OleView.exe:查看机器上的COM 组件。
    COM中导出GUID
    进程外组件以及进程间通信方式
    拼接多个 wchar_t *
    wstring to wchar_t*
    BSTR
    GetProcAddress 使用注意事项
    C++和.net的集合类对应
    COM的一些基本概念
    Error Lookup工具
  • 原文地址:https://www.cnblogs.com/xyzabc0004/p/8439283.html
Copyright © 2011-2022 走看看