Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
考虑以下情况:
SELECT TestPkg.getData(123) FROM dual;
返回正确的结果,但是
SELECT TestPkg.getData(SELECT TO_NUMBER('123') FROM dual) FROM dual;
给出错误作为缺少表达式,为什么会这样?如何处理我们将值传递给依赖于查询值的函数的这种情况。
要评估选择结果,您需要括号:
SELECT TestPkg.getData( (SELECT TO_NUMBER('123') FROM dual) ) FROM dual;
一对用于函数调用,一对用于评估选择结果。
我认为你需要:
SELECT TestPkg.getData(TO_NUMBER('123')) FROM dual;