473,385 Members | 1,267 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 9658
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

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

Similar topics

3
by: Jeff | last post by:
I am using SQL Server 2000. I have a table with, say, 20 columns. I have one procedure which updates all 20 columns at once, accepting a parameter for each column. However, I want to be able to...
2
by: Jeff Thur | last post by:
I am running a SQL Stored Procedure that will give the user a count of how many records are in the database as per certain criteria. I'm using the Execute Scalar Method. I have no problem passing...
1
by: T.S.Negi | last post by:
Dear Techies, I making one stored procedure, which does some operation based on an interface hash (#) table ---- name #mydata. This stored has two section of code (seperated by parameter value...
4
by: erich93063 | last post by:
I have a stored procedure which is performing a search against a "task" table. I would like to pass in a variable called @strAssignedTo which will be a comma delimeted list of employee ID's ie:...
4
by: Rhino | last post by:
Is it possible for a Java Stored Procedure in DB2 V7.2 (Windows) to pass a Throwable back to the calling program as an OUT parameter? If yes, what datatype should I use when registering the...
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
2
by: karups | last post by:
Hi, I've got listbox in my .aspx page where the users can make multiple selection. So, Users can select any number of items in listbox, I have to take value from items and pass it to stored...
4
Soniad
by: Soniad | last post by:
Hello, I am new to stored procedure, i am passing one parameter to stored procedure (comma seperated). i want to know how to split this variable inside stored procedure. Sample : Exec...
6
Soniad
by: Soniad | last post by:
Hello, I am excecuting a stored procedure in my ASP page , it has one out parameter (@confirm) . after executing the procedure i want to retreive this out parameter and assign it to variable...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.