Re: SQL fails on prepared LIMIT

Paul DuBois <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <p0621022fbec003c3d3e4@[192.168.1.35]>
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.


-- 
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.