create table CUX_IMPORT_DATA_E45 as
select * from CUX_IMPORT_DATA_L11
where 1>2;
CREATE TABLE CUX.lmh_segment1_E41 AS
SELECT * FROM CUX.lmh_segment1_L11
WHERE 1>2;
CUX.lmh_segment1_E41
CREATE TABLE CUX_IMPORT_DATA_E41 AS
SELECT * FROM CUX_IMPORT_DATA_L11
WHERE 1>2
DELETE FROM CUX_IMPORT_DATA_E41;
插入表中
INSERT INTO CUX_IMPORT_DATA_E41(A,ID)
select BBO.BILL_SEQUENCE_ID,rownum
from BOM_BILL_OF_MATERIALS BBO,
mtl_system_items_b msi
where bbo.ORGANIZATION_ID = msi.ORGANIZATION_ID
and bbo.ASSEMBLY_ITEM_ID = msi.inventory_item_id
and msi.ORGANIZATION_ID = 140
and msi.inventory_item_status_code="Active"
AND BBO.BILL_SEQUENCE_ID=664146
;
SELECT *
--DELETE
FROM CUX_IMPORT_DATA_E41;
分组
UPDATE CUX_IMPORT_DATA_E41 SET B = ROUND(ID/100);
BOM_BILL_OF_MATERIALS_200113;
CREATE TABLE BOM_BILL_OF_MATERIALS_20200401 AS
SELECT bbo.* FROM BOM_BILL_OF_MATERIALS bbo,
mtl_system_items_b msi
where bbo.ORGANIZATION_ID = msi.ORGANIZATION_ID
and bbo.ASSEMBLY_ITEM_ID = msi.inventory_item_id
and msi.ORGANIZATION_ID = 140
and msi.inventory_item_status_code="Active";
-- AND BBO.BILL_SEQUENCE_ID=664146
SELECT * FROM CUX.lmh_segment1_E41;
DELETE FROM CUX.lmh_segment1_E41;
DECLARE
CURSOR bom_cur IS
SELECT B FROM CUX_IMPORT_DATA_E41
group by B ;
BEGIN
FOR L_BOM IN bom_cur LOOP
insert into CUX.lmh_segment1_E41
select
TO_CHAR(msi.segment1) segment1,
TO_CHAR(msii.segment1) segment2,
bic.COMPONENT_QUANTITY,
cux_html_BOM_report.getSubStr(bic.COMPONENT_SEQUENCE_ID,140) sub_item,
cux_html_BOM_report.getdescStr2(bic.COMPONENT_SEQUENCE_ID) descstr,
cux_html_BOM_report.getRevisionStr(bbo.ASSEMBLY_ITEM_ID,140) REVISION,
bbo.attribute10
from BOM_BILL_OF_MATERIALS BBO,--20200401 BBO,
bom_inventory_components BIC,
mtl_system_items_b msi,
mtl_system_items_b msii
where BBO.BILL_SEQUENCE_ID = BIC.BILL_SEQUENCE_ID
and bbo.ORGANIZATION_ID = msi.ORGANIZATION_ID
and bbo.ASSEMBLY_ITEM_ID = msi.inventory_item_id
and bic.COMPONENT_ITEM_ID = msii.inventory_item_id
and bbo.ORGANIZATION_ID = 140
and msii.ORGANIZATION_ID = 140
AND msi.ORGANIZATION_ID = 140
and msii.inventory_item_status_code="Active"
and nvl(bic.DISABLE_DATE,sysdate+1)>sysdate
AND BBO.BILL_SEQUENCE_ID--=664146
in (SELECT A FROM CUX_IMPORT_DATA_E41 WHERE B = L_BOM.B);
END LOOP;
COMMIT;
END;
select segment1 ,segment2,component_quantity,sub_item , TO_CHAR(descstr ) A,revision ,attribute10 from CUX.lmh_segment1_E41
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341