本文介绍了表达式不能用作分配目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个具有以下查询的函数,但它返回上述错误.我认为问题在于aty的粗体字
I have a function with following query but it returns above error. I think the problem is with bold line specifically with aty
CREATE OR REPLACE FUNCTION QtyStkToQty ( itemcode VARCHAR2, qty NUMBER, ConUOM VARCHAR2 ) RETURN VARCHAR IS vSupuomcon float;
vConuomcon float;
vuom varchar2(3);
vunits number;
retval float;
nqty number;
CURSOR cur_uom_units(c_itemcode varchar2) IS
SELECT a.iu_uom_code,
a.iu_units
FROM
(SELECT iu_uom_code,
iu_units
FROM sm_uom
WHERE iu_item_code=c_itemcode
AND iu_freez='N'
AND rownum <= 3
ORDER BY iu_units ASC) a
ORDER BY iu_units DESC;
BEGIN retval:= 0;
IF qty<> 0 THEN OPEN cur_uom_units(itemcode);
FETCH cur_uom_units INTO vuom,
vunits;
LOOP FETCH cur_uom_units INTO vuom,
vunits;
EXIT WHEN cur_uom_units% NOTFOUND;
retval := retval +' '+ CAST(FLOOR(qty/ vunits) AS varchar2);
qty := qty-((qty/ vunits)*vunits);
END LOOP;
CLOSE cur_uom_units;
ELSE retval := 0;
RETURN retval;
END IF;
END;
推荐答案
这篇关于表达式不能用作分配目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!