Dear all,

I need to process postgresql table with DBI module. The script below works well for small tables, but when I want to process larger tables (100000 rows) out-of-memory occurs.

Any suggestion? Thanks in advance,
Andrej

use strict;
use warnings;
use DBI;

my $dbh = DBI->connect("DBI:Pg:dbname=medline;host=localhost", "postgres", "secret", {'RaiseError' => 1});
my $sth = $dbh->prepare("SELECT text_a, text_b FROM tmp_table");
$sth->execute();

while (my $ref = $sth->fetchrow_hashref()) {
   my $field_a = $ref->{'text_a'};
   my $field_b = $ref->{'text_b'};
   print "$field_a \t $field_b\n";
}


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to