Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Perl DBI and NULL vales from MSSQL

by sachmet (Scribe)
on Apr 30, 2001 at 21:06 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://76655]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found