it will work for or butif want to do the same thing using AND instead of OR then each time it has to do the comparision
is there any effective solution for AND
Hi,
One way of implementing that feature is to write a custom function which will may be accept one parameter as a delimited string containing all the keywords and the
other parameter as the source string and you can use
INSTR function in a loop.
Ofcourse this will be fairly simple and ineffecient way of doing it.
Coming to the LIKE operator , it will work fine but you will have to consider three different cases for three different positions of the keyword.
1) If it is the first word of the source string, you will have to use 'hi%'
2) If it is in the middle of the source string, you will have to use '%hi%'
3) If it is the last word of the source string, you will have to use '%hi'
And also since you are searching for words , you might have to use '% hi %'
as you also have a 'hi' in a 'while'. Of course you dont have to do this if you append spaces at the beginning and end of the source string.Looking at all the different possibilities, it is better off to write a custom function,even if has a little overhead.
A better solution anyone?