1

I have this query where I need to give input for the name variable similar to the second condition. How can I do this when I have a LIKE condition?

upper(name) LIKE upper('%name%')
 AND trunc(sysdate) - INTERVAL '&NumberDays' DAY ( 3 ) <= create_dt
2
  • 4
    upper(name) LIKE upper('%&name%')? Commented Jan 20, 2020 at 9:50
  • Thank you all, such a simple one. I might be blind Commented Jan 20, 2020 at 13:48

1 Answer 1

3

Oracle (actually, sqlplus) does litteral replacement when it encounters a variable prefixed with an amperstead, so you could simply do:

upper(name) LIKE upper('%&name%')
Sign up to request clarification or add additional context in comments.

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.