This is fine until your table outgrows your memory: selectall_arrayref will read all rows into memory and then pass it to csv (), whereas using a fetch handle has virtually no memory overhead.
my $sth = $dbh->prepare ("select * from foo"); $sth->execute; csv (out => "foo.csv", in => sub { $sth->fetch }, undef_str => "\\N");
In reply to Re^3: Select DB data into CSV file
by Tux
in thread Select DB data into CSV file
by 1nickt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |