Consider the following situation:
SELECT TestPkg.getData(123) FROM dual;
returns correct result, but
SELECT TestPkg.getData(SELECT TO_NUMBER('123') FROM dual) FROM dual;
gives error as missing expression, why is that so? How to tackle with such situation where we are passing value to function which is dependent on value from query.