[Maypole] no use of LIMIT in sql queries
Aaron Trevena
teejay@droogs.org
Wed, 30 Jun 2004 13:47:23 +0100 (BST)
On Tue, 29 Jun 2004, Perrin Harkins wrote:
> On Tue, 2004-06-29 at 19:22, Kevin wrote:
> > Any idea what I'm missing here? Why do no perl database modules support
> > the use of limits in select queries?
>
> There was some discussion of this on the Class::DBI list, so please take
> a look. As I recall, the gist of it was that LIMIT is proprietary to
> MySQL and there is no equivalent that is supported by all SQL92
> databases (although some other databases have their own incompatible
> syntax for it), so if someone wants this it needs to go into
> Class::DBI::MySQL. Feel free to raise it on the list again though if
> you have more ideas or patches.
I would suggest adding a line to the Class::DBI::Query::where that does a
check that the module being used (Class::DBI::mysql, etc) supports
limiting, I am pretty sure that every DB I have used (possibly including
Access, but my memory of that has been deliberately blocked through
careful application of drugs and alcohol as soon as that coursework was
completed and handed in) has provided some way of doing it.
That would seem a fairly sensible thing to do. The patch to
Class::DBI::Query::where would be trivial, along with an additional limit
attribute/method to set/unset it.
Please forward to the Class::DBI list, as I haven't subscribed to it yet.
(will subscribe later, as it seems a pre-requisite for answering many
things that crop up here).
cheers,
A.
--
Aaron J Trevena - Perl Hacker, Kung Fu Geek, Internet Consultant
AutoDia --- Automatic UML and HTML Specifications from Perl, C++
and Any Datasource with a Handler. http://droogs.org/autodia