Oracle For 循环,字符串拼接,查找
2018-02-10 17:44
429 查看
--------------------------------------------------------------------------------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; -------------------------------------------------------------------------------------
相关文章推荐
- oracle操作字符串:拼接、替换、截取、查找
- oracle操作字符串:拼接、替换、截取、查找
- oracle操作字符串:拼接、替换、截取、查找
- oracle操作字符串:拼接、替换、截取、查找
- oracle操作字符串:拼接、替换、截取、查找
- ios中的字符串等的拼接+for循环实例
- oracle for循环查找结果
- oracle操作字符串:拼接、替换、截取、查找、长度、判断
- oracle操作字符串:拼接、替换、截取、查找
- oracle操作字符串:拼接、替换、截取、查找
- Oracle 操作字符串:拼接、替换、截取、查找
- oracle操作字符串:拼接、替换、截取、查找(修改版)
- 字符串拼接代码中诡异的for循环和诡异的return
- oracle操作字符串:拼接、替换、截取、查找
- Java String 字符串拼接,截取,查找及日期转换
- oracle 数据库sql 语句 拼接字符串
- Oracle字符串截取和拼接应用 推荐
- 第一个爬虫教程的大坑,关于for循环打印字符串列表
- oracle 使用拼接字符串更新表
- Oracle中将查询出的多条记录的某个字段拼接成一个字符串的方法