Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 ( #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? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2022-05-24 18:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (84 votes). Check out past polls.

    Notices?