Re: SQL fails on prepared LIMIT
Jason Dixon <[email protected]>
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Message-ID | <[email protected]> |
On May 29, 2005, at 7:42 PM, Paul DuBois wrote:
> At 19:38 -0400 5/29/05, Jason Dixon wrote:
>> On May 29, 2005, at 7:29 PM, Paul DuBois wrote:
>>
>>> The placeholder mechanism is quoting the value, but the argument to
>>> LIMIT
>>> must be a literal integer. The tell DBD::mysql to treat the value as
>>> an integer, you can use bind_param(). For example:
>>>
>>> $rv = $sth->bind_param ($n, $value, { TYPE => DBI::SQL_INTEGER
>>> });
>>> $rv = $sth->bind_param ($n, $value, DBI::SQL_INTEGER);
>>
>> So why does it work ok on my main server running DBD::mysql 2.1021?
>> It doesn't seem like MySQL is enforcing the literal integer, but
>> DBD::mysql.
>
> Probably a version-specific change in placeholder parameters. Rudy
> might
> be able to clarify.
>
> Use bind_param(), it should work consistently across DBD::mysql
> versions.
Thanks, that seems to be working well.
--
Jason Dixon
DixonGroup Consulting
http://www.dixongroup.net
--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/[email protected]