-
Breaking string
Hi,
Can someone help me out.
I have a string like this abc#def#hij#klo coming in as a parameter.
Now I need to break this string with delimiter as # and have them in the where condition like
where col in ('abc','def','hij','klo')
Pl. note that this string can have any number of sub-strings like this delimited by #.
How do I do this?
Regards
Sonia
-
WHERE INSTR(input_string||'#', col||'#') <> 0
should work, but won't be efficient (can't use an index on col).
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
-
WHERE INSTR('#'||input_string||'#', '#'||col||'#') <> 0
would be even nicer - it should deal with variable length substrings.
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|