今天遇到一个问题, 由于用户想要返回规格字段,可是我Foundation实例中并没有查询并返回这个规格字段,主管的方法,就是在数据库中进行表的连接,然后返回这个规格字段。
--返回FOUNDATION的结果
:= '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;