本日经过议定点窜Oracle 数据库处置的一个ERP不能打出验收单标题.

 前导发轫:网海拾贝




 

/*
   推销要打印验收单,然则在PR, PO , 验收单上都没有输出ITEM!
   进程是从P R 改起,一 共改3 次,最终处置标题.
*/

 

select *
from po_headers_all
where segment1=20600172;

 

select *
from po_requisition_headers_all
where creation_date>to_date('2006-01-01','yyyy-mm-dd');

 

select *
from PO_requisition_headers_all
where segment1=10501804 ;
--先找到和点收单,PO的请购单

 

--查找到请购单的Id

 

select requisition_header_id
from po_requisition_headers_all
 where segment1=10501804

 

--96570

 

--update PR
update po_requisition_lines_all
set item_id=51132
where requisition_header_id=96570;

 

--view update
select  item_id
from po_requisition_lines_all
where requisition_header_id=96570;

 

--commit
commit;

 


--同上,查找出?P0
select po_header_id
from po_headers_all
where segment1=20600172
--66397

 

select item_id, po_line_id,po_lines_all.*
from po_lines_all
where po_header_id=66397;
--item_id 公开为空

 

--下面有一个触发,贯注更新item_id!
update po_lines_all
set item_id=51132
where po_header_id=66397
--如果有的话,用下面的语句update
update po_lines_all
set over_tolerance_error_flag='reject'
where po_header_id=66397
--查察异动的时辰发明用了验收单用了RCV_SHIPMENT_LINES (根据erp 界面查table而来)
select ITEM_ID
from RCV_SHIPMENT_LINES
where po_header_id=66397
--COMMIT
commit;
--照旧没有,验收单上
update RCV_shipment_lines
set item_id=51132
where po_header_id=66397
  
   --后来再update 一次验收单,终于可以了

 

--pr 行和pr 头的区别, PO 行和头的区别,通俗都是经过议定头找到行停止点窜.

--还要好好研讨一下pr转po的时辰,数据库事实如何设立了标记

--知道一个po, 如何去找pr?

--研讨来研讨去在头晕的时辰同时敬慕oracle 的巨年夜

以为有不少播种,如果前两个月前我看到这些代码,这么多table和view ,各table之间的关系我会以为是天书一样.当然现在写起来也不那么顺畅,然则,我可以不怕那上百行的sql 建表/view语句了.

有的时辰老是能以为到oracle 在数据库方面的巨年夜,一种永远你只会和他进修而不会跨越他的巨年夜,就像巨人microsoft一样,绝年夜多半步骤员的任务都是站在巨人的肩膀上停止.

另有一个礼拜要过年了,这边oracle曾经是承袭进步了,那边.net的sql server 又呈现了"sql server 不存在或会见被拒绝"的错误,我研讨了两个清早,依然没有下场.我本日去微软找了此方面的资料和sql server 2000 sp4.如果处置不好,这个年又在烦恼中渡过.




版权声明: 原创作品,答应转载,转载时请务必以超链接办法标明文章 原始情由 、作者信息和本声明。否则将清查纪律责任。

posted @ 2011-03-07 20:34  蓝色的天空III  阅读(135)  评论(0编辑  收藏  举报