12
返回列表 发新帖
楼主: zhuguangwei

求展开BOM的SQL语句

[复制链接]
论坛徽章:
0
11#
发表于 2012-6-4 09:21 | 只看该作者
我正有这个需求,先下了试试。谢谢!!!

使用道具 举报

回复
论坛徽章:
0
12#
发表于 2012-9-20 16:15 | 只看该作者
谢谢分享。

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
26
ITPUB9周年纪念徽章
日期:2012-08-22 15:49:59itpub13周年纪念徽章
日期:2014-09-28 10:55:55祖国65周年纪念徽章
日期:2014-10-07 02:45:33itpub13周年纪念徽章
日期:2014-10-08 15:19:55itpub13周年纪念徽章
日期:2014-10-08 15:19:55itpub13周年纪念徽章
日期:2014-10-08 15:19:55itpub13周年纪念徽章
日期:2014-10-08 15:19:55itpub13周年纪念徽章
日期:2014-10-08 15:19:55itpub13周年纪念徽章
日期:2014-10-08 15:19:55优秀写手
日期:2015-01-28 06:00:13
13#
发表于 2012-9-26 16:03 | 只看该作者
http://blog.csdn.net/pan_tian/article/details/8003586
Query1:Sql query to print BOM hierarchy for a given assembly item

    select level,bill_item_name,assembly_item_id,component_item_name, component_item_id  
    from apps.bomfg_bom_components  
    start with bill_item_name = '75100021'   --Replace your assembly_item_id to here  
    connect by prior component_item_name = bill_item_name;  

Query2:另外一个类似的脚本,通过Assembly查询BOM的组件情况(包含组件数量)

    SELECT 'Material' Material ,  
           (SELECT msi.segment1  
           FROM    mtl_system_items msi  
           WHERE   msi.inventory_item_id=bom.assembly_item_id  
           AND     msi.organization_id  =207  --Replace your organization_id to here  
           )  
           parent_item         ,  
           bom.assembly_item_id,  
           lpad('',2*(level-1))  
                  ||  
           (SELECT msi.segment1  
           FROM    mtl_system_items msi  
           WHERE   msi.inventory_item_id=bic.component_item_id  
           AND     msi.organization_id  =207  --Replace your organization_id to here  
           )  
                                 child_item   ,  
           bic.component_item_id child_item_id,  
           bic.bill_sequence_id               ,  
           bic.operation_seq_num              ,  
           level                              ,  
           bic.component_quantity  
    FROM   bom_inventory_components bic,  
           (SELECT *  
           FROM    bom_bill_of_materials  
           WHERE   organization_id=207 --Replace your organization_id to here  
           )  
           bom  
    WHERE  bom.bill_sequence_id=bic.bill_sequence_id   
    START WITH bom.assembly_item_id= 6088 ----Replace your assembly_item_id to here   
    CONNECT BY prior bic.component_item_id=bom.assembly_item_id;  

使用道具 举报

回复
论坛徽章:
0
14#
发表于 2014-1-15 13:31 | 只看该作者
出错啊! error msg:ORA-1008:not all variables bound.怎么回事?

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表