#!C:/Perl/bin/perl use strict; use DBI; use DBD::Sybase; use Data::Dumper; my $dbh = DBI->connect("dbi:Sybase:server=SERVER;database=DATABASE", "USER","PASSWORD") or die "Can not connect to database!"; my $sth = $dbh->prepare( qq{ select amount from trades_gdw_total }); $sth->execute(); while (my $rows = $sth->fetchall_arrayref([0], 3)) { last if ($#$rows <= 0); for (@$rows) { print "got @$_\n"; } print "---\n"; }