Re: Why isn't LIMIT functionality included in CDBI?
[prev]
[thread]
[next]
[Date index for 2004/05/21]
Alexander Karelas wrote:
> Why isn't LIMIT functionality included in CDBI?
>
> I know different database engines have different syntax for LIMIT, i.e.
> MySQL uses LIMIT x,y whereas Postgres uses LIMIT x OFFSET y, but still
> the developer could just write:
>
> { limit => "x,y" }, if he uses MySQL, and
> { limit => "x offset y" }, if he uses Postgres.
>
> Is there any reason this isn't desirable behaviour?
>
> Perhaps it should be implemented somewhere in Class::DBI::mysql?
>
> Alex
I believe this would have to be in the database-specific modules as
every database does it differently. For Oracle, the following syntax is
necessary to mimic MySQL's LIMIT function:
SELECT $columns FROM ( SELECT a.*, rownum rnum FROM ( $sql ) a WHERE
rownum <= $y ) WHERE rnum >= $x";
$sql is the entire SQL statement you want to limit.
I found this at
http://asktom.oracle.com/pls/ask/f?p=4950:8:140438119304640675::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:127412348064,
-Andy
|
|
Re: Why isn't LIMIT functionality included in CDBI?
Andy Grundman 17:40 on 21 May 2004
|