' PLS-00049:错误的绑定变量'编译功能时

时间:2018-06-13 07:09:50

标签: oracle plsql

编译此函数时出错:

  

PLS-00049:错误的绑定变量' RETURN_VALUE'

我需要帮助。

FUNCTION GECM_ROUND_FNC
          (P_FIELD_VALUE IN NUMBER,
           P_ORG_ID IN NUMBER) 
           RETURN VARCHAR2
IS
v_ret_val  NUMBER := P_FIELD_VALUE;
V_OU_NAME hr_operating_units.name%type;
v_round_dec   NUMBER;
BEGIN
    BEGIN
    SELECT NAME INTO V_OU_NAME
        FROM HR_ALL_ORGANIZATION_UNITS
        WHERE ORGANIZATION_ID = P_ORG_ID;
    EXCEPTION WHEN OTHERS THEN
        V_OU_NAME := '';
    END;
--
IF V_OU_NAME IS NOT NULL AND NVL(GECM_ICP_PKG.gecm_get_process_value_fnc('GECM_ERP_VALIDATIONS',V_OU_NAME,'','',''),'N')='Y' THEN
    BEGIN
        IF NVL(GECM_ICP_PKG.GECM_GET_PARAMETER_VALUE_FNC('GECM_ERP_VALIDATIONS','DECIMAL_ROUNDING_INTERFACES',V_OU_NAME,'',''),0) = 'Y' THEN
            BEGIN
                SELECT NVL(GECM_ICP_PKG.GECM_GET_PARAMETER_VALUE_FNC('GECM_ERP_VALIDATIONS','DECIMAL_PLACE_LIMIT',V_OU_NAME,'',''),0) 
                INTO v_round_dec from dual;  
                EXCEPTION
                WHEN OTHERS THEN
                v_round_dec := 0;
            END;
            IF v_round_dec <> 0 THEN
                v_ret_val:= TO_CHAR(ROUND(v_ret_val,v_round_dec));
            ELSE
                v_ret_val:=v_ret_val;
            END IF;
        END IF;
    END;
END IF;
SELECT to_char(decode(sign(v_ret_val-1),-1,decode('0'||to_number(v_ret_val),'00','0','0'||to_number(v_ret_val)),v_ret_val)) INTO v_ret_val FROM DUAL;
:return_value := v_ret_val;
END;

1 个答案:

答案 0 :(得分:0)

而不是

:return_value := v_ret_val;

使用

return v_ret_val;