Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks!

I have a form that queries a Microsoft sql server database and display the results to the screen, the problem a have is to show only, lets say 10 or 20 records at a time, it is called "paging", but the thing is, with Microsoft sql server is very complicated to do it. Does anyone here would know a better solution with Perl for me instead, other than try with stored procedures and nested complex sql queries?

Thanks a LOT for the Help!!!

Replies are listed 'Best First'.
Re: Paging using Perl
by davorg (Chancellor) on Oct 23, 2006 at 13:37 UTC

    You should look at Data::Page.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: Paging using Perl
by LTjake (Prior) on Oct 23, 2006 at 13:48 UTC

    There was a thread not too long ago that was pretty much exactly what you're asking: SQL Paging with Perl

    I believe my reply was a suitable response -- use SQL::Abstract::Limit. Here is the snippet i posted in my reply:

    use SQL::Abstract::Limit; my $sql = SQL::Abstract::Limit->new( limit_dialect => 'Top' ); # generate SQL: my ( $stmt, @bind ) = $sql->select( $table, \@fields, \%where, \@order +, $limit, +$offset ); # Then, use these in your DBI statements my $sth = $dbh->prepare( $stmt ); $sth->execute( @bind );

    --
    "Go up to the next female stranger you see and tell her that her "body is a wonderland."
    My hypothesis is that she’ll be too busy laughing at you to even bother slapping you.
    " (src)

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Paging using Perl
by kprasanna_79 (Hermit) on Oct 23, 2006 at 17:03 UTC
    Hi,

    When ever you want to go for paging in perl, always use HTML::Pager, which is widely used one.

    Check the Cpan site for more details


    Prasanna.K
      When ever you want to go for paging in perl, always use HTML::Pager, which is widely used one.

      What in the OP's question makes you think that it has to do anything with HTML or CGI, let alone that "when ever one want to go for paging in perl" it will?