> -----Original Message----- > From: Jonathan Leffler [mailto:[EMAIL PROTECTED] > Sent: 26 August 2008 16:26 > To: rupert; DBI Users Mailing List > Subject: Re: How do I reset dataset (statement handle) pointer? > > On Mon, Aug 25, 2008 at 6:25 AM, rupert <[EMAIL PROTECTED]> wrote: > > > I need to find a function or method that will reset or seek the > > dataset handle back to the beginning so I can fetchrow all over again > > without doing execute() functions all the time... > > > > [code] > > $dbConnection->{FetchHashKeyName} = "NAME_lc"; > > $dataGrid = $dbConnection->prepare("SELECT field, type FROM list"); > > $dataGrid->execute(); > > > > for($i=0; $i<3; $i++){ > > > > while ($fieldRow = $dataGrid->fetchrow_hashref()) { > > print $fieldRow->{'field'}; > > } > > > > #Nee to seek back to first row in $dataGrid here; > > $dataGrid->seekBackToFirstRow(); #I need a function to do it > here... > > #fails because no such method exists to do above > > } > > $dataGrid->finish(); > > [/code] > > > > The options I can think of include: > > * Redoing the execute. > * Using fetchall_arrayref() to collect all the data > * Requesting DBI add support for scroll cursors and then using them > > -- > Jonathan Leffler <[EMAIL PROTECTED]> #include <disclaimer.h> > Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org > "Blessed are we who can laugh at ourselves, for we shall never cease to be > amused." [Stewart Anderson] Have you looked at the "fetchall_arrayref" method ? that might help.
You could also run through the returned rows and populate to an array of your own for processing "properly" as often as you liked? - I guess Stu Information in this email including any attachments may be privileged, confidential and is intended exclusively for the addressee. The views expressed may not be official policy, but the personal views of the originator. If you have received it in error, please notify the sender by return e-mail and delete it from your system. You should not reproduce, distribute, store, retransmit, use or disclose its contents to anyone. Please note we reserve the right to monitor all e-mail communication through our internal and external networks. SKY and the SKY marks are trade marks of British Sky Broadcasting Group plc and are used under licence. British Sky Broadcasting Limited (Registration No. 2906991), Sky Interactive Limited (Registration No. 3554332), Sky-In-Home Service Limited (Registration No. 2067075) and Sky Subscribers Services Limited (Registration No. 2340150) are direct or indirect subsidiaries of British Sky Broadcasting Group plc (Registration No. 2247735). All of the companies mentioned in this paragraph are incorporated in England and Wales and share the same registered office at Grant Way, Isleworth, Middlesex TW7 5QD.
