I am reading through a set of rows using DBI, fetchrow_array and a WHILE
loop. For each loop, I have to do some updates and do a commit. But, this
commit closes the cursor and when I try to fetch the next row, I get the
error "FETCH ATTEMPTED ON AN UNOPENED CURSOR".
I know that this can be overcome in Informix 4GL by specifying "with hold"
while opening the cursor. How is this done using DBI ?
This is what my program looks like -
$dbh = DBI->connect("dbi:Informix:database", undef, undef, {PrintError => 1,
AutoCommit => 0}) || die Could not connect to flm database";
$sth = $dbh->prepare("SQL Statement");
$sth->execute;
while (($value) = $sth->fetchrow_array)
{
Update Statement....
Update Statement....
$dbh->commit;
}
$sth->finish;
$dbh->disconnect;
Thank you very much.
Eldho Thomas
Enterprise Rent-A-Car