On Wed, Sep 03, 2003 at 04:24:28PM -0700, Konigsberg, Jay wrote:
> Hi all,
> 
> The Perl DBI doesn't support INSERT, or UPDATE cursors, which is a pity,
> because they can dramatically reduce the time it takes for many programs to run.

Driver for databases which support named cursors should support
functionality something like this:

my $select_sth = $dbh->prepare("SELECT ... from t FOR UPDATE");
$select_sth->execute;
my $update_sth = $dbh->prepare("UPDATE t SET f=? WHERE CURRENT OF 
$select_sth->{CursorName}");
while (my $row = $select_sth->fetchrow_arrayref) {
    $update_sth->execute(...);
}

Tim.

Reply via email to