1

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.

2 Answers 2

5

To evaluate a select result you need brackets:

SELECT TestPkg.getData( (SELECT TO_NUMBER('123') FROM dual) ) FROM dual;

One pair for the function call, one for the evaluation of the select result.

Sign up to request clarification or add additional context in comments.

Comments

1

I think you need:

SELECT TestPkg.getData(TO_NUMBER('123')) FROM dual;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.