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

今天遇到一个问题,  由于用户想要返回规格字段,可是我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;

猜你喜欢

转载自blog.csdn.net/grace_1203/article/details/81028272