Hi all,
Does anyone know if it is possible to do a keyword search such as the
follows:
Parameter: a long string, Keywords1, containing several keywords
Store procedure do: Retrieve in Field1 of Table1 if it contains one or
more of the words contained in Keywords1.
Seems so simple. However the challange is to retrieve the record if it
contains one or more of the words supplied. Hence, in the following
scenerio,
Table1
ID Field1
-- ------
1 moon sun sky star
2 car boat plane
Search:
Keyword1 = "car moon"
Both records in table1 should be retrieve.
I have tried to do this in the stored procedure:
However, it only works if the keyword1 contains only 1 field. I know
that in order to accomplish the above, we need a query like:
(Keyword1_1 and Keyword1_2 are the words tokenized in Keyword1. In our
example, Keyword1_1 = "car" and Keyword1_2 = "moon")
So is it possible to do something like parsing a long string and store
the keywords in an array in stored procedure, and then construct the
SQL dynamically in stored procedure.
Any help is appreciated!!
Thanks in advance!
Stephen