表达式不能用作分配目标
问题描述:
我有一个具有以下查询的函数,但它返回上述错误.我认为问题在于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;
答
我不熟悉oracle,但您被允许更改传入参数的值?可能是类型不匹配的问题吗?
I''m not familiar with oracle, but are you permitted to change the value of an incoming parameter? Could it be a type mismatch problem?