From: Peter Brawley Date: July 25 2006 10:27pm Subject: Re: arrays in stored procedures - pl. help List-Archive: http://lists.mysql.com/mysql/200280 Message-Id: <44C69AD2.9070804@earthlink.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=======AVGMAIL-44C69AD25C45=======" --=======AVGMAIL-44C69AD25C45======= Content-Type: multipart/alternative; boundary=------------030701090108080302030004 --------------030701090108080302030004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit My question is how do I send multiple sets of data into a stored procedure without doing the things I had outlined. MySQL doesn't have arrays. Pass the data in a comma-delimited string and PREPARE the statement, or pass it as a temp memory table. PB ----- L P wrote: > Chris, > thank you for the response, but that was not my question. > My question is how do I send multiple sets of data into a stored > procedure > without doing the things I had outlined. > > > On 7/17/06, Chris wrote: >> >> L P wrote: >> > Folks, >> > say I have a need to add multiple rows at the same time. >> > >> > for instance, say I'm collecting customer information and I want to >> add >> 3 >> > addresses and 3 phone numbers at the same time for a customer. >> > >> > The above is quite straightforward to accomplish when there is only >> one >> set >> > of data to deal with (one address / one phone number) - with simple >> data >> > types passed in as parameters. >> > >> > What alternatives / options do I have to accomplish storing multiple >> > sets of >> > data? >> >> insert into table(field1, field2, field3) values (value1, value2, >> value3), (value4, value5, value6); >> >> http://dev.mysql.com/doc/refman/5.1/en/insert.html >> >> Don't use arrays for storage, you'll lose a lot of performance. >> >> > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.1.394 / Virus Database: 268.10.4/396 - Release Date: 7/24/2006 > --------------030701090108080302030004 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit My question is how do I send multiple sets of data into a stored procedure
without doing the things I had outlined.

MySQL doesn't have arrays. Pass the data in a comma-delimited string and PREPARE the statement, or pass it as a temp memory table.

PB

-----

L P wrote:
Chris,
thank you for the response, but that was not my question.
My question is how do I send multiple sets of data into a stored procedure
without doing the things I had outlined.


On 7/17/06, Chris <dmagick@stripped> wrote:

L P wrote:
> Folks,
> say I have a need to add multiple rows at the same time.
>
> for instance, say I'm collecting customer information and I want to add
3
> addresses and 3 phone numbers at the same time for a customer.
>
> The above is quite straightforward to accomplish when there is only one
set
> of data to deal with (one address / one phone number) - with simple data
> types passed in as parameters.
>
> What alternatives / options do I have to accomplish storing multiple
> sets of
> data?

insert into table(field1, field2, field3) values (value1, value2,
value3), (value4, value5, value6);

http://dev.mysql.com/doc/refman/5.1/en/insert.html

Don't use arrays for storage, you'll lose a lot of performance.




No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.4/396 - Release Date: 7/24/2006
--------------030701090108080302030004-- --=======AVGMAIL-44C69AD25C45======= Content-Type: text/plain; x-avg=cert; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Description: "AVG certification" No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.4/396 - Release Date: 7/24/2006 --=======AVGMAIL-44C69AD25C45=======--