Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Perl DBI and NULL vales from MSSQL

by sachmet (Scribe)
on Apr 30, 2001 at 21:06 UTC ( #76655=note: print w/replies, xml ) Need Help??


in reply to Perl DBI and NULL vales from MSSQL

Yes. You get an undef whenever the field is null, because you might actually want to store the value 'NULL' in a field for some reason.

If you care to print out a NULL in the case of an undef, you can always do:
while (my $row = $sth->fetchrow_arrayref) { foreach my $field (@$row) { $field = '(NULL)' unless defined($field); } ... (the rest of your code) ... }
and that should take care of your problem.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://76655]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2021-04-19 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?