RE: Resetting of the dataset

From: Brian Barto (brian.barto_at_spectrum-health.org)
Date: 12/16/04


To: beginners@perl.org
Date: Thu, 16 Dec 2004 15:39:35 -0500

I don't think there is a way to make fetchrow_array() reverse the sequence
in which it delivers data. You can always store the data in a variable if
you need to use it later. Otherwise, if you are receiving rows of data from
the database in an order that makes it hard to work with you may want to try
asking the database to send the data in a different order by using "ORDER
BY" in your select statement.

If that doesn't help, can I ask why you need to step backwards through the
rows of data? Maybe we can figure something else out...

-----Original Message-----
From: Nicolay Vasiliev [mailto:nvasiliev@whiteriversoft.com]
Sent: Thursday, December 16, 2004 10:14 AM
To: beginners@perl.org
Subject: Resetting of the dataset

Hello there!

I have some dataset got by the executing of some query. For example:

my $sth = $dbh->prepare('select * from sometable');
$sth->execute();

Going through this dataset by $sth->fetchrow_array() I need to go back
inside this proccess. Sorry, but I have no idea how can I do this. How
can I reset this dataset to move to the first record?

TIA.

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Relevant Pages

  • Re: Problem using VBA to create sequentially numbered documents in Word
    ... if you have multiple users and a single common number sequence, by definition you are going to need the source of those numbers to be in a location which is available to all the users. ... but a database nevertheless. ... A simpler method would be to store a document variable in the template ...
    (microsoft.public.word.vba.beginners)
  • Re: problem using identity column as primary key
    ... >> I am thinking of creating an identity column to use it as primary key ... More and more programmers who have absolutely no database training are ... the gap in the sequence is not filled in and the sequence ... vin CHARNOT NULL REFERENCES Motorpool); ...
    (microsoft.public.sqlserver.programming)
  • Re: public and private mailboxes randomly dismounting
    ... When posting logs an important piece is the Event ID and Source. ... Information Store First Storage Group: An attempt to move the file ... An error occurred while writing to the database log file of storage group ...
    (microsoft.public.windows.server.sbs)
  • Re: cant mount information store
    ... I then reinstalled exchange and then installed exchange 2003 ... Information Store First Storage Group: Database recovery failed ... Microsoft Exchange Information Store. ...
    (microsoft.public.windows.server.sbs)
  • Re: Many Exchange errors!
    ... Event Source: ESE ... Information Store First Storage Group: An attempt to move the file ... An error occurred while writing to the database log file of storage group ...
    (microsoft.public.windows.server.sbs)