Wildcard search by selecting keyword from table column
Hi Everybody,
I am working on selecting wildcard search by selecting keyword from one table and updating some column in other table.
E.g:
I have two tables: KEY & MATCH
Table KEY has two columns:
WORD PERSON
________________________
An Apple Mac
A City David
A Cell John
Table MATCH has two columns: STMT & OWNER
STMT OWNER
________________________________________
There is An Apple here OWNER1
There is a city nearby OWNER2
Is this a cell or not? OWNER3
Is this not an apple to eat? OWNER4
I need to have an sp which will select WORD from table KEY and search for that pattern in column STMT in table MATCH and if pattern is found and it has to update OWNER of MATCH table as PERSON from KEY table, respective to WORD.
I cant hardcode the WORD to fing in STMT, as there are number of columns in KEY table in real and moreover, KEY column may keep on increasing in future and if we hardcode, it will need changes in sp too.
Please help me in this situation.
I will really appreciate your comments and answers. Thank you very much.