Author: spadkins
Date: Mon Mar 15 12:25:40 2010
New Revision: 13860

Modified:
   p5ee/trunk/App-Repository/bin/dbget

Log:
added --startrow and --endrow

Modified: p5ee/trunk/App-Repository/bin/dbget
==============================================================================
--- p5ee/trunk/App-Repository/bin/dbget (original)
+++ p5ee/trunk/App-Repository/bin/dbget Mon Mar 15 12:25:40 2010
@@ -4,7 +4,7 @@
 
 use App::Options (
     options => [ qw(dbhost dbname dbuser dbpass repository table params 
columns headings order_by compact decimals subtotal_columns totals
-                    distinct cache_skip cache_refresh verbose) ],
+                    distinct startrow endrow cache_skip cache_refresh verbose) 
],
     option => {
         repository => {
             default => "default",
@@ -45,6 +45,12 @@
         distinct => {
             description => "Select only distinct rows",
         },
+        startrow => {
+            description => "The first row to fetch (numbered from 1)",
+        },
+        endrow => {
+            description => "The last row to fetch (numbered from 1)",
+        },
         order_by => {
             description => "List of columns to order by",
         },
@@ -110,9 +116,11 @@
         $headings = $App::options{headings} ? [ split(/,/, 
$App::options{headings}) ] : [];
         $get_options = { extend_columns => 1 };
     }
-    $get_options->{distinct} = 1 if ($App::options{distinct});
-    $get_options->{order_by} = [ split(/,/, $App::options{order_by}) ] if 
($App::options{order_by});
-    $get_options->{cache_skip} = 1 if ($App::options{cache_skip});
+    $get_options->{distinct}      = 1 if ($App::options{distinct});
+    $get_options->{order_by}      = [ split(/,/, $App::options{order_by}) ] if 
($App::options{order_by});
+    $get_options->{startrow}      = $App::options{startrow} if 
($App::options{startrow});
+    $get_options->{endrow}        = $App::options{endrow}   if 
($App::options{endrow});
+    $get_options->{cache_skip}    = 1 if ($App::options{cache_skip});
     $get_options->{cache_refresh} = 1 if ($App::options{cache_refresh});
     my $rows     = $db->get_rows($table, $params, $columns, $get_options);
     my ($subtotal_rows, $total_rows);

Reply via email to