$sth->execute(...); my $serial_num = '0' x 50_000; # Or more? $sth->bind_col(1, \$serial_num); while ($sth->fetch()) { print "$serial_num\n"; }