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."

Reply via email to