/* 采购要打印验收单,但是在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.如果解决不好,这个年又在烦恼中度过.
|