将参数传递给函数时在oracle中返回null?

问题描述 投票:0回答:1

这是我的功能

---Write procedure for retrive data----
CREATE OR REPLACE FUNCTION retrieve_decrypt(
    custid  in NUMBER
)
RETURN sys_refcursor
IS
    decrypt_value sys_refcursor;
BEGIN
     open decrypt_value for Select custname,contactno, enc_dec.decrypt(creditcardno,password) as  
       creditcardno ,enc_dec.decrypt(income,password) as 
            income  from employees where custid=custid ;
    RETURN decrypt_value;
END;
/

我这样叫它:SELECT retrieve_decrypt(5) FROM DUAL;然后它只返回{}。

enter image description here

但是我,硬编码qazxsw poi而不是qazxsw poi .it将正确返回结果。需要一些专家帮助来解决这个问题。

custid=5

database oracle stored-procedures stored-functions
1个回答
1
投票

不要将参数命名为列;如果列名是custid=custid,则让参数为enter image description here。否则,它会导致问题(如您所见)。

在你的例子中:

custid
© www.soinside.com 2019 - 2024. All rights reserved.