in reply to Re: Simple db select output script hanging up.
in thread Simple db select output script hanging up.
I agree that named, specific columns are better in most cases than SELECT *, but if you don't have your constraints and NULLABLEs set correctly, you can still end up with NULLs where you don't expect them. So I'd say either die on undef (if you want to check that your database logic ensures no NULLs) or, something along the lines of:
while(my $results = $sth->fetchrow_arrayref) { push @data, [map {defined($_) ? $_ : ''} @$results]; }
|
|---|