Thanks for taking a look at this.  The addition will be most appreciated.
And to correct my earlier code, I had copied missed copied the code block
from a previous version I had.  The correct block is:

if (defined $limit && !$use_prefix_limit) {
      if ($dbh->{'Driver'}{'Name'} eq 'Oracle') {
          if ($limit =~ m/(\d+)(\sOFFSET\s(\d+))?/) {
              my $o_size = $1;
              my $o_start = $3 ? $3 : 0;
              my $o_end = $o_start + $o_size;
              $qs = q[ select * from (select oquery.*, rownum oracle_rownum
from (] .
                    $qs .
                    q[) oquery where rownum <= ?) where oracle_rownum > ?];
              push @bind, $o_end, $o_start;
          }
      } else {
          $qs .= "\nLIMIT "    . $limit;
      }
  }


The lines my $o_start and my $o_end are correct in this one.

-Kevin



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John
Siracusa
Sent: Monday, December 04, 2006 1:10 PM
To: Rose::DB::Object list
Subject: Re: [RDBO] Oracle LIMIT and Paging

On 12/4/06, Kevin McGrath <[EMAIL PROTECTED]> wrote:
> I have been trying to switch from Class::DBI to Rose::DB using Oracle 
> as my database.  I discovered that limiting and paging do not work 
> with oracle because oracle does not regonize LIMIT.

Oracle is not fully supported by RDBO, as you've discovered.  I'll try
incorporate your changes in the next release (although not quote as you have
implemented them).  Thanks for the information.  I knew Oracle did
limit/offset strangely, but didn't recall exactly how.

-John

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's
Techsay panel and you'll get the chance to share your opinions on IT &
business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to