Jump to content

passing an array as input parameters to a stored procedure?


Juarez
Go to solution Solved by lemmin,

Recommended Posts

Hi

I will be receiving a text file with the  values below on a regular basis. I'm creating a form where the final aim is to import each row  of these values and use each row of values as the parameters of a stored procedure in MYSQL. There is only one stored procedure so I will run the stored procedure the required number of times with each row of values and output the results as one result set.

 

My question is about the best method to achive this before I start. Would it be best to import the values to an array and then use the array as the input parameter for the stored procedure or import them to a temp table or something?

 

 

 

 

chr start end
chr22 50478251 50481750
chr22 50313501 50331250
chr22 50543751 50557250
chr22 50637751 50645250
chr22 50904001 50929000
 

 

 

 

thanks

Link to comment
Share on other sites

  • Solution

I believe you can only pass string variables when calling a stored procedure. Since you would need to pass a bunch of different variables instead, I would lean toward the temp table solution. You probably won't even need to call the procedure multiple times if you already have the data in a table.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.