函数中无法取到查询值,求解
create or replace function F_GET_HLTS_TEST(bkh in varchar2, xh in integer, hldm in varchar2) return number is
Result number(10,3);
hlzts number(10,3);
begin
select case when sum(sl) is null then 0 else sum(sl) end as hlzts into Result from t_z_brfy_mx where bkh_zy = bkh and ryxh=xh and yzbm =hldm and fyzt = '1';
return(Result);
end F_GET_HLTS_TEST;
select F_GET_HLTS_TEST('0729450',1,'H0003') FROM DUAL;
这样调用为什么无法取得实际值。每回都是返回:0
但将语句拿出来单独执行时却能得到值:10
求指教!
------解决方案--------------------晚上没有人逛了?
------解决方案--------------------求高手指导!