You shouldn't need dynamic SQL for that.
For example, if you're always interested in suingle-character substrings, and you're getting the input as a single string called str (e.g. '123' meaning you want to find rows where x contains '1', '2' or '3'), then you could say:
WHERE REGEXP_LIKE ( x
, '[' || str || ']'
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements), a few inputs, and also post the results you want from each input given the same data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 126.96.36.199.0).
See the forum FAQ: https://forums.oracle.com/message/9362002#9362002
1 person found this helpful
To expand on Frank's suggestion a bit (and I may be understanding your requirement differently than he), the following may suit your needs:
WHERE REGEXP_LIKE(x, '[a-z A-Z][0-9][a-z A-Z]')
Based on the example you provided, it seems like your goal might be to return records where a single whole number exists that is preceeded and proceeded by something (in this case, I'm going to assume one or more uppercase or lowercase letters on either side).