电脑知识|欧美黑人一区二区三区|软件|欧美黑人一级爽快片淫片高清|系统|欧美黑人狂野猛交老妇|数据库|服务器|编程开发|网络运营|知识问答|技术教程文章 - 好吧啦网

您的位置:首頁技術文章
文章詳情頁

ORACLE ERP導數據(BOM清單)

瀏覽:159日期:2023-11-16 11:42:54
方法:把數據導入BOM清單的方法是,把數據導入接口表中,讓其自動運行既可。上傳文件的時候,要注重使;;;用ASCII字符模式。1、自己建立一中轉表drop table cux_bill_temp;create table cux_bill_temp( ; bill_sequence_id ;number, assembly_item_id;number, organization_id;number, assembly_item;;varchar2(50),--BOM component_sequence_id;;;number, component_quantity;;;number, --組件數量 item_num;;;;number, --項目序列 operation_seq_num;;;number, --工序序列 component_item_id;;;number, component_item;;;varchar2(50),; --組件 PLANNING_FACTOR;;;number,;;--計劃%d100 component_yield_factor;;number,;;--產出率d1 wip_supply_type;;;number,;;--供給類型 supply_type;;;;varchar2(50), supply_subinventory;;;varchar2(50),;--供給子庫存 OPTIONAL;;;;number,;;--可選的 OPTIONAL_disp;;;;varchar2(10),;--可選的 MUTUALLY_EXCLUSIVE_OPTIONS ;;number,;;--互不相容 MUTUALLY_EXCLUSIVE_O_disp;;varchar2(10),;--互不相容 attribute1;;;;varchar2(50),--排序號 row_num;;;;number)2、刪除中轉表中的數據 delete cux_bill_temp;3、把要導入的數據放在擴展名為*.csv的文件中,且要相對應于中轉表的字段,本例中的文件名為bill.csv。 另外的腳本文件為bill.ctl,其內容如下:options (skip=1); //跳過第一行,一般第一行為其字段說明LOAD DATAINFILE bill.csv; //bill.csv為數據文件APPENDINTO TABLE cux_bill_tempFIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '''(與中轉表相對應的字段列表)登錄進入Oracle數據庫服務器,利用命令:(sqlload 用戶名/密碼@數據庫名)載入文件bill.csv的數據入中轉表。4、查看中轉表中的記錄數(以備導入數據后進行對比) select count(*) from cux_bill_temp;5、去除導入時在表bill.csv中的要害字段的空格字符,以免影響導入。 update cux_bill_temp set ASSEMBLY_ITEM=replace(ASSEMBLY_ITEM,' ',''), COMPONENT_ITEM=replace(COMPONENT_ITEM,' ','');6、查看是否有重復的選項(既是否重復了Item) select assembly_item,component_item,min(row_num),count(*) from cux_bill_temp group by assembly_item,component_item having count(*)>1;假如有重復的Item,則要刪除(或是重新合并)delete cux_bill_tempwhere row_num in (select min(row_num) from cux_bill_temp group by assembly_item,component_item having count(*)>1);以下步驟為選做(如有重復才做,沒有重復不做7-10)7、再重新建立一個臨時表(對于有重復數據,則只取一條數據,現取row_num最小的一條) drop table cux_bill_a;create table cux_bill_aasselect assembly_item,component_item,component_quantity,PLANNING_FACTOR,component_yield_factor,supply_type,supply_subinventory,OPTIONAL_disp,MUTUALLY_EXCLUSIVE_O_disp,attribute1,min(row_num) row_numfrom cux_bill_tempgroup by assembly_item,component_item,component_quantity,PLANNING_FACTOR,component_yield_factor,supply_type,supply_subinventory,OPTIONAL_disp,MUTUALLY_EXCLUSIVE_O_disp,attribute1;8、刪除cux_bill_temp表 delete cux_bill_temp;9、再重cux_bill_a表中把數據導入給cux_bill_temp表,完成把重復數據剔除的功能insert into cux_bill_temp(assembly_item,component_item,component_quantity,PLANNING_FACTOR,component_yield_factor,supply_type,supply_subinventory,OPTIONAL_disp,MUTUALLY_EXCLUSIVE_O_disp,attribute1,row_num)select assembly_item,component_item,component_quantity,PLANNING_FACTOR,component_yield_factor,supply_type,supply_subinventory,OPTIONAL_disp,MUTUALLY_EXCLUSIVE_O_disp,attribute1,row_numfrom cux_bill_a;10、刪除表cux_bill_a drop table cux_bill_a;11、再檢查一次表,是否有重復的數據 select assembly_item,component_item,min(row_num),count(*)from cux_bill_tempgroup by assembly_item,component_itemhaving count(*)>1;12、查看在mtl_system_items表中,既是在庫存表中,有沒有不存在的Item.select distinct itemfrom (select distinct assembly_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment1=b.assembly_item and organization_id=2)unionselect distinct component_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment1=b.component_item and organization_id=2))order by item;13、假如在mtl_system_items中,有不存在的物品ITEM時,要把其刪除(或是把這些物品Item導入到系統中) 刪除:delete cux_bill_temp b where; not exists (select null from mtl_system_items where segment1=b.component_item and organization_id=2); delete cux_bill_temp a where not exists; (select null from mtl_system_items where segment1=a.assembly_item; and organization_id=2);14、對沒有物品Item的進行處理,把其放入另一臨時表cux_item_temp中(以備查詢及導入mtl_system_items表中) delete cux_item_temp; insert into cux_item_temp(segment1,description)select distinct item,itemfrom (select distinct assembly_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment1=b.assembly_item and organization_id=2)unionselect distinct component_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment1=b.component_item and organization_id=2))將找到沒有ITEM的BOM數據放到另一個表中,以備下次ITEM導入后在導BOMcreate table cux_bom_temp1select distinct itemfrom (select distinct assembly_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment1=b.assembly_item and organization_id=2)unionselect distinct component_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment1=b.component_item and organization_id=2))-----------------------------------------------------------------------------------------------------------15、從表mtl_system_items中把物品的編碼ID加入中轉表cux_bill_temp表(從項目主組織)中 update cux_bill_temp b set assembly_item_id=(select inventory_item_id from mtl_system_items where segment1=b.assembly_item and organization_id=2), component_item_id=(select inventory_item_id from mtl_system_items where segment1=b.component_item and organization_id=2);16、查看是否有沒有物品ID的編碼存在(既沒有物品的ID被導入臨時表cux_bill_temp中) select row_num from cux_bill_temp where assembly_item_id is null or component_item_id is null;17、對其中導入的數據進行處理 update cux_bill_temp set OPTIONAL=1 where upper(OPTIONAL_disp) like 'Y%'; update cux_bill_temp set OPTIONAL=2 where OPTIONAL is null; update cux_bill_temp set MUTUALLY_EXCLUSIVE_OPTIONS=1 where upper(MUTUALLY_EXCLUSIVE_O_DISP) like 'Y%'; update cux_bill_temp set MUTUALLY_EXCLUSIVE_OPTIONS=2 where MUTUALLY_EXCLUSIVE_O_DISP is null;18、查看cux_bill_temp中的數據處理是否有漏 select count(*) from cux_bill_temp where OPTIONAL is null or MUTUALLY_EXCLUSIVE_OPTIONS is null or assembly_item_id is null or component_item_id is null;19、更新其內的WIP_SUPPLY_TYPE; update cux_bill_temp set WIP_SUPPLY_TYPE=6 where component_item like 'B%';20、刪除表中的包(cux_bill_temp中),其相對應于表bom_bill_of_materials(既在表中已經存在了些選項包,不必導入包頭,只需導入包內容既可) delete cux_bill_temp twhere exists (select null from bom_bill_of_materials where assembly_item_id=t.assembly_item_id and organization_id=2);21、利用已經寫好的包寫入數據(既寫入接口表bom_bill_of_mtls_interface) exec cux_bom_temp.insert_bill_15(1);select count(*) from cux_bill_temp tempwhere exits (select null from bom_inventory_components; b where temp.bill_sequence_id=b.bill_sequence_id and temp.component_item_id=b.component_item_id);delete cux_bill_temp tempwhere exists (select null from bom_inventory_components; b where b.bill_sequence_id=temp.bill_sequence_id and b.component_item_id=temp.component_item_id); exec cux_bom_temp.insert_bill_10(1);22、對寫入的數據在接口表中的情況進行查看 select count(*) from bom_bill_of_mtls_interface;23、接著更新 exec cux_bom_temp.insert_bill_15(1); select count(*) from cux_bill_temp where bill_sequence_id is null; exec cux_bom_temp.insert_bill_20(1);去提交請求select count(*) from bom_inventory_comps_interface;(導入成功后)對組件進行排序 exec cux_bom_temp.update_bill_item_num4; select count(*) from bom_inventory_comps_interface;24、對于接口表中的數據進行導入delete bom_bill_of_mtls_interface;insert into bom_bill_of_mtls_interface(assembly_type,assembly_item_id,organization_id, process_flag,transaction_type)select ;distinct 1,assembly_item_id,1,1,'CREATE'from cux_bill_temp;
標簽: Oracle 數據庫
主站蜘蛛池模板: 北京租车公司_汽车/客车/班车/大巴车租赁_商务会议/展会用车/旅游大巴出租_北京桐顺创业租车公司 | ★店家乐|服装销售管理软件|服装店收银系统|内衣店鞋店进销存软件|连锁店管理软件|收银软件手机版|会员管理系统-手机版,云版,App | 即用型透析袋,透析袋夹子,药敏纸片,L型涂布棒-上海桥星贸易有限公司 | 老城街小面官网_正宗重庆小面加盟技术培训_特色面馆加盟|牛肉拉面|招商加盟代理费用多少钱 | 钢格板_钢格栅_格栅板_钢格栅板 - 安平县鑫拓钢格栅板厂家 | 厚壁钢管-厚壁无缝钢管-小口径厚壁钢管-大口径厚壁钢管 - 聊城宽达钢管有限公司 | 公交驾校-北京公交驾校欢迎您! 工作心得_读书心得_学习心得_找心得体会范文就上学道文库 | 齿轮减速马达一体式_蜗轮蜗杆减速机配电机-德国BOSERL齿轮减速电动机生产厂家 | 精密五金冲压件_深圳五金冲压厂_钣金加工厂_五金模具加工-诚瑞丰科技股份有限公司 | 岛津二手液相色谱仪,岛津10A液相,安捷伦二手液相,安捷伦1100液相-杭州森尼欧科学仪器有限公司 | 地脚螺栓_材质_标准-永年县德联地脚螺栓厂家 | 快速卷帘门_硬质快速卷帘门-西朗门业 | 电机铸铝配件_汽车压铸铝合金件_发动机压铸件_青岛颖圣赫机械有限公司 | 选矿设备-新型重选设备-金属矿尾矿重选-青州冠诚重工机械有限公司 | 红外光谱仪维修_二手红外光谱仪_红外压片机_红外附件-天津博精仪器 | 篷房|仓储篷房|铝合金篷房|体育篷房|篷房厂家-华烨建筑科技官网 知名电动蝶阀,电动球阀,气动蝶阀,气动球阀生产厂家|价格透明-【固菲阀门官网】 | 一体化预制泵站-一体化提升泵站-一体化泵站厂家-山东康威环保 | 安规_综合测试仪,电器安全性能综合测试仪,低压母线槽安规综合测试仪-青岛合众电子有限公司 | 四合院设计_四合院装修_四合院会所设计-四合院古建设计与建造中心1 | 本安接线盒-本安电路用接线盒-本安分线盒-矿用电话接线盒-JHH生产厂家-宁波龙亿电子科技有限公司 | 杭州实验室尾气处理_实验台_实验室家具_杭州秋叶实验设备有限公司 | 超声波分散机-均质机-萃取仪-超声波涂料分散设备-杭州精浩 | 涂层测厚仪_漆膜仪_光学透过率仪_十大创新厂家-果欧电子科技公司 | 挨踢网-大家的导航!| PC构件-PC预制构件-构件设计-建筑预制构件-PC构件厂-锦萧新材料科技(浙江)股份有限公司 | 日本细胞免疫疗法_肿瘤免疫治疗_NK细胞疗法 - 免疫密码 | 色油机-色母机-失重|称重式混料机-称重机-米重机-拌料机-[东莞同锐机械]精密计量科技制造商 | 数年网路-免费在线工具您的在线工具箱-shuyear.com | 诺冠气动元件,诺冠电磁阀,海隆防爆阀,norgren气缸-山东锦隆自动化科技有限公司 | 磁棒电感生产厂家-电感器厂家-电感定制-贴片功率电感供应商-棒形电感生产厂家-苏州谷景电子有限公司 | 合肥弱电工程_安徽安防工程_智能化工程公司-合肥雷润 | 手持式浮游菌采样器-全排二级生物安全柜-浙江孚夏医疗科技有限公司 | 台湾阳明固态继电器-奥托尼克斯光电传感器-接近开关-温控器-光纤传感器-编码器一级代理商江苏用之宜电气 | 杭州月嫂技术培训服务公司-催乳师培训中心报名费用-产后康复师培训机构-杭州优贝姆健康管理有限公司 | 自动化生产线-自动化装配线-直流电机自动化生产线-东莞市慧百自动化有限公司 | 北京西风东韵品牌与包装设计公司,创造视觉销售力!| 知企服务-企业综合服务(ZiKeys.com)-品优低价、种类齐全、过程管理透明、速度快捷高效、放心服务,知企专家! | 论文查重_免费论文查重_知网学术不端论文查重检测系统入口_论文查重软件 | 重庆LED显示屏_显示屏安装公司_重庆LED显示屏批发-彩光科技公司 重庆钣金加工厂家首页-专业定做监控电视墙_操作台 | 胜为光纤光缆_光纤跳线_单模尾纤_光纤收发器_ODF光纤配线架厂家直销_北京睿创胜为科技有限公司 - 北京睿创胜为科技有限公司 | 东莞螺丝|东莞螺丝厂|东莞不锈钢螺丝|东莞组合螺丝|东莞精密螺丝厂家-东莞利浩五金专业紧固件厂家 |