I'd like to use "LIKE", but I can't.
Posted: Wed Apr 18, 2007 10:15 am
I'm going buggy looking through Oracle-related postings, and so far haven't seen this issue addressed.
Basically, I'm creating user-defined SQL in an Oracle Enterprise stage. I want to use the LIKE constraint in my SQL with a variable, but I can't get it to work. As in:
WHERE COL1 LIKE '%ORCHESTRATE.KEYFLD'
The reason is that Oracle requires me to put quotes around the qualifying string (which contains the % character). But putting in the quotes (either single or double) passes the variable name as a literal. But I obviously need the variable resolved.
If I was doing this in shell scripting I would simply use double instead of single quotes - but in DS that doesn't seem to make a difference. I could probably add the '%' character to the qualifying variable upstream, and lose the quotes altogether, but for reasons I won't get into here I reeeeeally want to avoid doing that.
Any ideas as to what syntax I can use (if any) to make this happen?
Thanks,
-> Richard
Basically, I'm creating user-defined SQL in an Oracle Enterprise stage. I want to use the LIKE constraint in my SQL with a variable, but I can't get it to work. As in:
WHERE COL1 LIKE '%ORCHESTRATE.KEYFLD'
The reason is that Oracle requires me to put quotes around the qualifying string (which contains the % character). But putting in the quotes (either single or double) passes the variable name as a literal. But I obviously need the variable resolved.
If I was doing this in shell scripting I would simply use double instead of single quotes - but in DS that doesn't seem to make a difference. I could probably add the '%' character to the qualifying variable upstream, and lose the quotes altogether, but for reasons I won't get into here I reeeeeally want to avoid doing that.
Any ideas as to what syntax I can use (if any) to make this happen?
Thanks,
-> Richard