函数中的声明变量有什么问题

问题描述

我正在尝试声明函数并传递变量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)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...