问题描述
我正在尝试声明函数并传递变量fixed_cost = 0 IN INT
之类的
FUNCTION GET_ALL_ENABLED_ACC(fixed_cost IN INT)
因此,关键是要声明fixed_cost并将值初始化为0
,但会出错
Error(37,16): PLS-00103: Encountered the symbol " " when expecting one of the following: . ( * @ % & = - + ; < / > at in is mod remainder not rem <an exponent (**)> <> or != or ~= >= <= <> and or like like2 like4 likec between using || multiset member submultiset The symbol " " was ignored.
我尝试类似
fixed_cost : = 0 IN INT
AND
fixed_cost =: 0 IN INT
我还尝试将INT更改为NUMBER,并在BEGIN
初始化值之后,但是不起作用。
FUNCTION GET_ALL_ENABLED_ACC(fixed_cost NUMBER)
RETURN SYS_REFCURSOR IS
rc SYS_REFCURSOR;
BEGIN
OPEN rc FOR
fixed_cost = 0;
SELECT Number_ FROM accounting_plan WHERE Enabled = 1 AND FixedCost = fixed_cost;
RETURN rc;
END GET_ALL_ENABLED_ACC;
在这种情况下我该怎么办?
解决方法
必须为FUNCTION GET_ALL_ENABLED_ACC(fixed_cost IN INT:=0)
或FUNCTION GET_ALL_ENABLED_ACC(fixed_cost IN INT default 0)