in reply to Re: Posgres batch read with DBI?
in thread Posgres batch read with DBI?
Many thanks for the pointer. Running this (SqlSupport is a homebrew helper module):
It's saying the last bracket is unmatched. But my IDE shows every bracket has a mate, and I clipped the whole while loop from the DBI docs.use lib qw ( c:/perlmodules ); use SqlSupport; my $dbh = connectpgdb(*,*,*,*,*); my $query = "select id,post from blog where language = 'en'"; my $sth = $dbh->prepare($query); $sth->execute || die "Could not execute MySQL statement: $sqlstatement +"; my $rows = []; # cache for batches of rows while( my $row = ( shift(@$rows) || shift(@{$rows=$sth->fetchall_array +ref(undef,10_000) || []}))) { my $foo = 1; } $sth->finish();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Posgres batch read with DBI?
by choroba (Cardinal) on Jan 26, 2021 at 23:32 UTC | |
by cormanaz (Deacon) on Jan 26, 2021 at 23:58 UTC | |
by AnomalousMonk (Archbishop) on Jan 27, 2021 at 02:30 UTC |
In Section
Seekers of Perl Wisdom