470,863 Members | 2,028 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,863 developers. It's quick & easy.

myqsl stored procedure passing comma seperated list as parameter

Hi All,

I have one problem here with mysql stored procedures.

I have a list of ids seperated by comma e.g., (" 'A', 'B', 'C' "). I am passing the same to mysql stored procedure as a parameter. I want to use these values in where clause of select statement using IN.

I can't use prepared statements because queries written in stored procedure are very complex.
Aug 21 '08 #1
1 9245
You could use a function to split the the string like one of these :

The first one returns a table and you could query that table into the IN part of your query.

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM some_table WHERE id IN (SELECT id FROM func_table)
Aug 22 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by erich93063 | last post: by
4 posts views Thread by Rhino | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.