Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Substituting '--' for Nulls

by rattusillegitimus (Friar)
on Aug 13, 2002 at 14:57 UTC ( #189813=note: print w/replies, xml ) Need Help??


in reply to Substituting '--' for Nulls

Not knowing DB2 myself, I may be wrong, but couldn't you do something like the following (untested) SQL statement to make the database to the substitution for you?

SELECT if(field,field,'--') as field FROM table;

MySQL also has an IFNULL expression, but again, I don't know enough about DB2 to know if it has one too.

- $0.02 from the rat

__________
He seemed like such a nice guy to his neighbors / Kept to himself and never bothered them with favors
- Jefferson Airplane, "Assassin"

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2021-02-27 17:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?