GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TENG::PLUGIN::SQLPAGER (3)

.ds Aq ’

NAME

Teng::Plugin::SQLPager - Paginate with SQL

CONTENTS

SYNOPSIS



    package My::DB;
    use parent qw/Teng/;
    __PACKAGE__->load_plugin(qw/SQLPager/);

    # in your application
    $db->search_by_sql_with_pager(
        q{SELECT * FROM member ORDER BY id DESC},
        [],
        {page => 1, rows => 20}
    );



DESCRIPTION

This module searches database by SQL with paginate.

search_by_sql_with_pager method adds LIMIT clause automatically.

ARGUMENTS FOR search_by_sql_with_pager

You can pass arguments as following.

CW$db->search_by_sql_with_pager($sql, $binds, $opt[, $table_name]);

$sql: Str This is a SQL statement in string.
$binds: ArrayRef[Str] This is a bind values in arrayref.
$opt: HashRef Options for search_by_sql_with_pager. Important options are ’page’ and ’rows’.

<B>pageB> is a current page number. <B>rowsB> is a entries per page.

$table_name: Str You can pass a table name.

This argument is optional. If you don’t pass a table name, Teng guess table name automatically.

LIMITATIONS

This module does not work with Oracle since Oracle does not support limit clause.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TENG::PLUGIN::SQLPAGER (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.