Use one variable for multiple binds

--bound1095065640
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I dont know if this is possible.
when calling execute with one variable that holds multiple placeholders.

Similar to this.
$dbh->execute($variable)
the $variable holds multiple values ie..
$variable="bindinfo1,bindinfo2"

My problem is mysql expects 2 bind variables ie.. $dbh->execute($variable1,$variable2)

I am trying to select when not knowing the number of requisites.

Hoping is something small I am overlooking.

Thank you for any help you can give me
Arthur



--bound1095065640
Content-Type: text/plain; charset=us-ascii

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules [at] m .gmane.org
--bound1095065640--
art [ Mo, 13 September 2004 10:54 ] [ ID #44273 ]

Re: Use one variable for multiple binds

Newbedford.net wrote:
> I dont know if this is possible.
> when calling execute with one variable that holds multiple placeholders.
>
> Similar to this.
> $dbh->execute($variable)
> the $variable holds multiple values ie..
> $variable="bindinfo1,bindinfo2"

Hopefully, this will never be the case. IMO, it is completely up to you,
to implement the logic, if, and when, to apply something as simple as

my [at] vars;
if (hasMultipleVars($variable)) {
[at] vars = split(/,/, $variable);
} else {
[at] vars = ($variable);
}

If you disagree, I'd be interested to learn, how you suggest the drivers
implementation of hasMultipleVars($variable).

Jochen

--
http://lilypie.com/baby1/050423/1/5/1/+1

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules [at] m .gmane.org
Jochen Wiedmann [ Mo, 13 September 2004 09:34 ] [ ID #44274 ]

Re: Use one variable for multiple binds

--bound1095097138
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Solution was as simple as i had hoped
Use array when calling execute
Many Thnaks to all that helped
Arthur


--bound1095097138
Content-Type: text/plain; charset=us-ascii

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules [at] m .gmane.org
--bound1095097138--
art [ Mo, 13 September 2004 19:38 ] [ ID #44275 ]

Re: Use one variable for multiple binds

Newbedford.net wrote:
> I dont know if this is possible.
> when calling execute with one variable that holds multiple placeholders.
>
> Similar to this.
> $dbh->execute($variable)
> the $variable holds multiple values ie..
> $variable="bindinfo1,bindinfo2"

Hopefully, this will never be the case. IMO, it is completely up to you,
to implement the logic, if, and when, to apply something as simple as

my [at] vars;
if (hasMultipleVars($variable)) {
[at] vars = split(/,/, $variable);
} else {
[at] vars = ($variable);
}

If you disagree, I'd be interested to learn, how you suggest the drivers
implementation of hasMultipleVars($variable).

Jochen

--
http://lilypie.com/baby1/050423/1/5/1/+1

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules [at] m .gmane.org
Jochen Wiedmann [ Mo, 13 September 2004 09:34 ] [ ID #180824 ]

Re: Use one variable for multiple binds

--bound1095097138
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Solution was as simple as i had hoped
Use array when calling execute
Many Thnaks to all that helped
Arthur


--bound1095097138
Content-Type: text/plain; charset=us-ascii

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules [at] m .gmane.org
--bound1095097138--
art [ Mo, 13 September 2004 19:38 ] [ ID #180825 ]
Datenbanken » gmane.comp.db.mysql.perl » Use one variable for multiple binds

Vorheriges Thema: prepared statement and embedded server support on Dev-2_9 CVS
Nächstes Thema: Use one variable for multiple binds