|
|
sybperl-l Archive
Up Prev Next
From: "BAHRI, SOFIENNE" <sofienne dot bahri at bell dot ca>
Subject: question MaxRows
Date: Sep 6 1999 6:04PM
Michael,
when I run the program that you have sent me, I always get more the ten
10
rows. and my MaxRows attribute is set to 10 and I get mostly all the
result set.??????
>
>
>
> >#!/usr/local/bin/perl -w
> >
> >use strict;
> >use CGI;
> >
> >use Sybase::CTlib;
> >
> >my $q = new CGI;
> >my $dbh = new Sybase::CTlib 'webuser', 'webuser', 'server';
> >
> >print $q->header;
> >print $q->start_html;
> >print $q->start_form;
> >
> >my $state = $q->param('__state') || 0;
> >
> >SWITCH_STATE: {
> > if($state == 0) {
> > $dbh->{MaxRows} = 10;
> > my $rows = $dbh->ct_sql("select account_no, name, last_change,
> >balance from account order by account_no", undef, 1);
> > print "\n";
> > my $last;
> > foreach my $row (@$rows) {
> > print "\n";
> > foreach my $col (keys(%$row)) {
> > print "| $row->{$col} | ";
> > }
> > $last = $row->{account_no};
> > print " \n";
> > }
> > print " \n";
> > $q->param('last_account', $last);
> > $q->param('__state', 1);
> > print $q->hidden('__state');
> > print $q->hidden('last_account');
> > print $q->submit('Next');
> > } elsif($state == 1) {
> > my $last = $q->param('last_account');
> > my $rows = $dbh->ct_sql("select account_no, name, last_change,
> >balance from account where account_no > $last order by account_no",
undef, 1);
> > print "\n";
> > my $last;
> > foreach my $row (@$rows) {
> > print "\n";
> > foreach my $col (keys(%$row)) {
> > print "| $row->{$col} | ";
> > }
> > $last = $row->{account_no};
> > print " \n";
> > }
> > print " \n";
> > $q->param('last_account', $last);
> > $q->param('__state', 1);
> > print $q->hidden('__state');
> > print $q->hidden('last_account');
> > print $q->submit('Next');
> > }
> >}
> >
> >print $q->end_form;
> >print $q->end_html;
> >
> >exit;
> >
>
>
>
-----------------------------------------------------------
Sofienne Bahri Bell Canada
Directeur-CSR
700,De la Gauchetière O., RC Mezz, Montréal (PQ) H3B-4L1
Téléphone :+1 514 391 4114
Pagette :+1 514 801 2186
Email :sofienne.bahri@ bell.ca
-----------------------------------------------------------
|