WHERE col_name IN(....)
This may not be possible, or possible using a different method, however, I'd like to send in a comma separated list of possible values, for instance i've got a keyword table, my customer searches for something like 'Hello World' I'd like to be able to make the statement WHERE keyword IN('Hello', 'World'). Obviously from PHP this is easy if i create the entire statement. Howerver is it possible to send in Hello and World a preset list and end up with some like
CREATE PROCEDURE `keywordsearch`(keyword_list VARCHAR(150))
BEGIN
SELECT * FROM keywords
WHERE keyword_txt IN(keyword_list);
END
then send it a list like "'hello','world'".
Now i should say that the above is leagal, and will work if I send it "hello" by it self, or "world" by it self, but then flunks when I send it the two together. I'm sure because it's treating it as an entire string.
Subject
Views
Written By
Posted
WHERE col_name IN(....)
4554
February 10, 2006 04:36PM
2538
February 11, 2006 12:47PM
1765
February 13, 2006 11:02AM
1847
February 13, 2006 01:52PM
1966
February 13, 2006 05:02PM
1907
February 13, 2006 06:16PM
1987
February 14, 2006 04:19PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.