Oracle has an NVL command such that you can say:
select NVL( email, "NO EMAIL PROVIDED" )
from table;
and if email is NULL then NO EMAIL PROVIDED will be returned.
I know that mySQL has a similar mechanism, but I don't know what it is
called (it might be NVL). I would try to do that.
-----Original Message-----
From: Aaron Shurts
To: [EMAIL PROTECTED]
Sent: 12/6/2001 11:18 PM
Subject: PERL MySQL DBI
Okay, I was the one that asked the crazy question about the weird join,
but I got that figured out. Now I have a problem.
while( ($login, $existingemail, $areacode, $prefix, $rest) =
$sth->fetchrow_array ())
{
print "$login,$existingemail,$areacode-$prefix-$rest\n";
}
That code is inside my foreach statement, but existingemail is an
optional field. If there is no email address given, I would like to
print out "NO EMAIL PROVIDED". How do I do this within my while loop.
When this report is run, it is piped to a csv file so that it can easily
be imported into Excel. Thanks in advance for the help.
Aaron Shurts
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]