Hi ALL,
I am writing a script to retreive entries from a DB. And then I loop through all the entries.
Once I am done looping through all the result sets, I have to re-loop over them again.
This is done in an infinite loop (Please don't ask why to do it infinitely :P).
The script is as follows.
$sth = $dbh->prepare($sql);
$sth->execute;
while()
{
while(@row = $sth->fetchrow_array())
{
//Working on the row returned.
}
}
The code has a wrapped infinite loop around it. So you can see the code as well, how I want it to work.
$sql is the sql query I am firing.
In PHP we have a function mysql_data_seek to resuse the result set.
Do we have something similar in Perl?
I am using DBI to make connection with MySql Database.
I will appreciate any help!
Regards
Vaibhav