Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Deviloper
I guess thats a task you can achieve with the correct sql-statement. Have a look at http://www.adp-gmbh.ch/ora/sql/examples/first_rows.html. How you can implement an sql-query that give you the results you need, depends on how the data in your db looks like. If you have a fixed index number for

RE: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Stewart Anderson
> -Original Message- > From: Amit Saxena [mailto:[EMAIL PROTECTED] > Sent: 11 September 2008 12:53 > To: Perl Beginners > Cc: Amit Saxena > Subject: Fetching "n" number of records at a time in Perl DBI ! > > Hi all, > > I am looking for a "fetch" function to fetch "n" number of records at

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Dr.Ruud
"Amit Saxena" schreef: > I am looking for a "fetch" function to fetch "n" number of records at > a time in Perl DBI ! If $max_rows is defined and greater than or equal to zero then it is used to limit the number of rows fetched before returning. fetchall_arrayref() can then be called again to fe

RE: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Stewart Anderson
> -Original Message- > From: Dr.Ruud [mailto:[EMAIL PROTECTED] > Sent: 11 September 2008 14:01 > To: beginners@perl.org > Subject: Re: Fetching "n" number of records at a time in Perl DBI ! > > "Amit Saxena" schreef: > > > I am loo

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread jm
there is a LIMIT option for the SELECT statement that will return the number of records you desire. $sth = $dbh->prepare("select from LIMIT "); $sth->execute(); while ($vars ...) = $sth->fetchrow_array()) { } # or whatever syntax best suits your preferences On Thu, Sep 11, 2008 at 6:53 AM, A

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Dr.Ruud
jm schreef: > there is a LIMIT option for the SELECT statement that will return the > number of records you desire. > > $sth = $dbh->prepare("select from arguments> LIMIT "); > $sth->execute(); > > while ($vars ...) = $sth->fetchrow_array()) > { > } > # or whatever syntax best suits your prefer

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Amit Saxena
On Thu, Sep 11, 2008 at 8:01 PM, Dr.Ruud <[EMAIL PROTECTED]<[EMAIL PROTECTED]> > wrote: > jm schreef: > > > there is a LIMIT option for the SELECT statement that will return the > > number of records you desire. > > > > $sth = $dbh->prepare("select from > arguments> LIMIT "); > > $sth->execute(

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Dr.Ruud
"Amit Saxena" schreef: > Dr.Ruud: >> jm: >>> there is a LIMIT option for the SELECT statement that will return >>> the number of records you desire. >>> >>> $sth = $dbh->prepare("select from >> arguments> LIMIT "); >>> $sth->execute(); >>> >>> while ($vars ...) = $sth->fetchrow_array()) >>> { >>

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Amit Saxena
On Fri, Sep 12, 2008 at 12:01 AM, Dr.Ruud <[EMAIL PROTECTED]<[EMAIL PROTECTED]> > wrote: > "Amit Saxena" schreef: > > Dr.Ruud: > >> jm: > > >>> there is a LIMIT option for the SELECT statement that will return > >>> the number of records you desire. > >>> > >>> $sth = $dbh->prepare("select from

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Raja Vadlamudi
On Thu, Sep 11, 2008 at 11:12 PM, Amit Saxena <[EMAIL PROTECTED]>wrote: > On Fri, Sep 12, 2008 at 12:01 AM, Dr.Ruud > <[EMAIL PROTECTED] <[EMAIL PROTECTED]>< > [EMAIL PROTECTED] <[EMAIL PROTECTED]>> > > wrote: > > > "Amit Saxena" schreef: > > > Dr.Ruud: > > >> jm: > > > > >>> there is a LIMIT opti

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread dan
On Thu, 11 Sep 2008 17:23:22 +0530, Amit Saxena <[EMAIL PROTECTED]> wrote: > Hi all, > > I am looking for a "fetch" function to fetch "n" number of records at a > time > in Perl DBI ! I had to do this kind of thing to implement 'record paging' in Gtk2::Ex::DBI. The way I did it was in a couple o

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Amit Saxena
On Fri, Sep 12, 2008 at 9:36 AM, Raja Vadlamudi <[EMAIL PROTECTED]> wrote: > > > On Thu, Sep 11, 2008 at 11:12 PM, Amit Saxena <[EMAIL PROTECTED]>wrote: > >> On Fri, Sep 12, 2008 at 12:01 AM, Dr.Ruud >> <[EMAIL PROTECTED] <[EMAIL PROTECTED]>< >> [EMAIL PROTECTED] <[EMAIL PROTECTED]>> >> > wrote: >

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Amit Saxena
On Fri, Sep 12, 2008 at 9:53 AM, dan <[EMAIL PROTECTED]> wrote: > On Thu, 11 Sep 2008 17:23:22 +0530, Amit Saxena <[EMAIL PROTECTED]> > wrote: > > > Hi all, > > > > I am looking for a "fetch" function to fetch "n" number of records at a > > time > > in Perl DBI ! > > I had to do this kind of thing

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread dan
On Fri, 12 Sep 2008 10:24:58 +0530, Amit Saxena wrote: > The only issue with this approach is that two queries needs to be run > for the same. > > Considering the tables containing 1 million (and more) rows, this two > pass approach will not be good. > > What others say ? It's precisely becaus

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Amit Saxena
On Fri, Sep 12, 2008 at 10:52 AM, dan <[EMAIL PROTECTED]> wrote: > On Fri, 12 Sep 2008 10:24:58 +0530, Amit Saxena wrote: > > > The only issue with this approach is that two queries needs to be run > > for the same. > > > > Considering the tables containing 1 million (and more) rows, this two > >

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-11 Thread Raymond Wan
Hi Amit, Generally, what Dan says is correct, but his suggestion isn't *the* answer that will work for everyone. He is correct about the size of a data column and the problem of retrieving all of the data. Also, an index is usually build on the primary key, so the first fetch should be fas

Re: Fetching "n" number of records at a time in Perl DBI !

2008-09-13 Thread Dr.Ruud
dan schreef: > Amit Saxena: >> I am looking for a "fetch" function to fetch "n" number of records >> at a time in Perl DBI ! > > I had to do this kind of thing to implement 'record paging' in > Gtk2::Ex::DBI. The way I did it was in a couple of steps. > > 1) Run a query to *only* select primary ke