在数据库中添加返回规格的字段

今天遇到一个问题,  由于用户想要返回规格字段,可是我Foundation实例中并没有查询并返回这个规格字段,主管的方法,就是在数据库中进行表的连接,然后返回这个规格字段。

打开PL/SQL,然后找到Packages包下面的PKG_BOM_UTIL,右击PKG_BOM_UTIL,点击编辑说明与体,然后找到fun_get_whereused,编辑体,在”--返回FOUNDATION的结果”的地方,添加返回规格(Specification)的内容,具体修改如下 。

  --返回FOUNDATION的结果

      l_sql
      := 'select ' || const_systemfields.columns_systemfields || ',r.Specification 
            from ma_foundation f$,item_r r,
                 (select n.end1guid,
                         n.authtype
                    from (select m.end1guid,
                                 m.authtype,
                                 to_number(row_number() over(partition by m.end1guid
                                                       order by m.authtype
                                                  )) rowindex
                            from temp_bomstructure_whereused m
                         ) n
                   where n.rowindex = 1
                 ) acl
           where f$.guid = acl.end1guid and f$.guid = r.foundationfk
           order by f$.id, f$.revisionid';


      open l_usedbom_cur for l_sql;
      return l_usedbom_cur;

  end fun_get_whereused;

以前是这个样子的

 --·µ»ØFOUNDATIONµÄ½á¹û
      l_sql
      := 'select ' || const_systemfields.columns_systemfields || '
            from ma_foundation f$,
                 (select n.end1guid,
                         n.authtype
                    from (select m.end1guid,
                                 m.authtype,
                                 to_number(row_number() over(partition by m.end1guid
                                                       order by m.authtype
                                                  )) rowindex
                            from temp_bomstructure_whereused m
                         ) n
                   where n.rowindex = 1
                 ) acl
           where f$.guid = acl.end1guid
           order by f$.id, f$.revisionid';


      open l_usedbom_cur for l_sql;
      return l_usedbom_cur;
  end fun_get_whereused;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值