468,512 Members | 1,457 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 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 8896
You could use a function to split the the string like one of these :
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648

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)
  2.  
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.