在Oracle ERP中导数据(BOM清单)

在Oracle ERP中导数据(BOM清单),第1张

方法:把数据导入BOM清单的方法是 把数据导入接口表中 让其自动运行既可 上传文件的时候 要注意使 用ASCII字符模式自己建立一中转表 drop table cux_bill_tempcreate table cux_bill_temp(bill_sequence_id number assembly_item_id number anization_id number assembly_item varchar ( ) BOMponent_sequence_id number ponent_quantity number 组件数量item_num number 项目序列operation_seq_num number 工序序列ponent_item_id number ponent_item varchar ( ) 组件PLANNING_FACTOR number 计划%d ponent_yield_factor number 产出率d wip_supply_type number 供应类型supply_type varchar ( ) supply_subinventory varchar ( ) 供应子库存OPTIONAL number 可选的OPTIONAL_disp varchar ( ) 可选的MUTUALLY_EXCLUSIVE_OPTIONS number 互不相容MUTUALLY_EXCLUSIVE_O_disp varchar ( ) 互不相容attribute varchar ( ) 排序号row_num number) 删除中转表中的数据 delete cux_bill_temp 把要导入的数据放在扩展名为* csv的文件中 且要相对应于中转表的字段 本例中的文件名为bill csv 另外的脚本文件为bill ctl 其内容如下:options (skip= ) //跳过第一行 一般第一行为其字段说明LOAD DATAINFILE bill csv //bill csv为数据文件APPENDINTO TABLE cux_bill_tempFIELDS TERMINATED BY OPTIONALLY ENCLOSED BY (与中转表相对应的字段列表)登录进入ORACLE数据库服务器 利用命令:(sqlload 用户名/密码@数据库名)载入文件bill csv的数据入中转表查看中转表中的记录数(以备导入数据后进行对比) select count(*) from cux_bill_temp 去除导入时在表bill csv中的关键字段的空格字符 以免影响导入 update cux_bill_tempset ASSEMBLY_ITEM=replace(ASSEMBLY_ITEM ) PONENT_ITEM=replace(PONENT_ITEM ) 查看是否有重复的选项(既是否重复了Item) select assembly_item ponent_item min(row_num) count(*)from cux_bill_tempgroup by assembly_item ponent_itemhaving count(*)>如果有重复的Item 则要删除(或是重新合并)delete cux_bill_tempwhere row_num in (select min(row_num) from cux_bill_tempgroup by assembly_item ponent_itemhaving count(*)>)以下步骤为选做(如有重复才做 没有重复不做 ) 再重新建立一个临时表(对于有重复数据 则只取一条数据 现取row_num最小的一条) drop table cux_bill_acreate table cux_bill_aasselect assembly_item ponent_item ponent_quantity PLANNING_FACTOR ponent_yield_factor supply_type supply_subinventory OPTIONAL_disp MUTUALLY_EXCLUSIVE_O_disp attribute min(row_num) row_numfrom cux_bill_tempgroup by assembly_item ponent_item ponent_quantity PLANNING_FACTOR ponent_yield_factor supply_type supply_subinventory OPTIONAL_disp MUTUALLY_EXCLUSIVE_O_disp attribute 删除cux_bill_temp表 delete cux_bill_temp 再重cux_bill_a表中把数据导入给cux_bill_temp表 完成把重复数据剔除的功能 insert into cux_bill_temp(assembly_item ponent_item ponent_quantity PLANNING_FACTOR ponent_yield_factor supply_type supply_subinventory OPTIONAL_disp MUTUALLY_EXCLUSIVE_O_disp attribute row_num)select assembly_item ponent_item ponent_quantity PLANNING_FACTOR ponent_yield_factor supply_type supply_subinventory OPTIONAL_disp MUTUALLY_EXCLUSIVE_O_disp attribute row_numfrom cux_bill_a 删除表cux_bill_a drop table cux_bill_a 再检查一次表 是否有重复的数据 select assembly_item ponent_item min(row_num) count(*)from cux_bill_tempgroup by assembly_item ponent_itemhaving count(*)> 查看在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 segment =b assembly_item and anization_id= )unionselect distinct ponent_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment =ponent_item and anization_id= ))order by item 如果在mtl_system_items中 有不存在的物品ITEM时 要把其删除(或是把这些物品Item导入到系统中) 删除:delete cux_bill_temp bwhere not exists (select null from mtl_system_items where segment =ponent_item and anization_id= )delete cux_bill_temp awhere not exists (select null from mtl_system_items where segment =a assembly_item and anization_id= ) 对没有物品Item的进行处理 把其放入另一临时表cux_item_temp中(以备查询及导入mtl_system_items表中) delete cux_item_tempinsert into cux_item_temp(segment description)select distinct item itemfrom (select distinct assembly_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment =b assembly_item and anization_id= )unionselect distinct ponent_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment =ponent_item and anization_id= ))将找到没有ITEM的BOM数据放到另一个表中 以备下次ITEM导入后在导BOMcreate table cux_bom_temp select distinct itemfrom (select distinct assembly_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment =b assembly_item and anization_id= )unionselect distinct ponent_item itemfrom cux_bill_temp bwhere not exists (select null from mtl_system_items where segment =ponent_item and anization_id= ))从表mtl_system_items中把物品的编码ID加入中转表cux_bill_temp表(从项目主组织)中 update cux_bill_temp bset assembly_item_id=(select inventory_item_id from mtl_system_itemswhere segmen lishixinzhi/Article/program/Oracle/201311/18605

ORACLE 其实是一个公司,它有很多产品,其中包括 ORACLE 数据库

其实 ORACLE 公司近年已经开始转型到企业 ERP 软件方案等方向,他们有专门针对中小企业的 ERP 解决方案,主要使用的就是他们自己的数据库产品,和SUN 公司的 JAVA 方向的产品。

现在很多时候大家在考虑 SAP 产品时都会同时以 ORACLE 产品做比较,不过相对来说 ORACLE ERP 产品更加灵活,但是针对性还是太差,有发展,但是目前来说实施成功率远不能与 SAP 相提并论

一般大型点的ERP管理系统的后台数据都存储在计算机上,为了方便管理维护这些数据,后台又会用到数据库软件。oracle就是对数据进行管理的一种数据软件之一。如果ERP采用oralce数据库那么orace就是ERP后台数据管理系统。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/9427801.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-28
下一篇2023-04-28

发表评论

登录后才能评论

评论列表(0条)

    保存