Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Handling Null or Undef values in DBI (and things of those nature)...

by kwoff (Friar)
on Jan 08, 2002 at 04:36 UTC ( [id://137006]=note: print w/replies, xml ) Need Help??


in reply to Handling Null or Undef values in DBI (and things of those nature)...

Question 1: grep `perldoc DBI` for "undef":

undef NULL values are represented by undefined values in Perl

You might check like:
$employee_id = (defined $row[0]) ? $row[0] : '';

Question 2: do a select for that row. Using fetchrow_array(), it will return an empty list if there wasn't a row, so

@foo = $sth->fetchrow_array(); if (@foo) { ... } else { ... }
I use MySQL, so maybe Oracle has fancier features, for which read the manual.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-18 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found