How about this:
push (@state, $states) if ($states !~ /\s*/);
And, as a suggestion:
$error=$db -> Sql($stmt);
if ($error) {
$db->Close();
print "Error: " . Win32::ODBC::Error() . "<br>\n";
exit;
}
-----Original Message-----
From: Toddy Prawiraharjo [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 14, 2001 11:27 PM
To: perl; [EMAIL PROTECTED]
Subject: get rid of Null result
I think my question is for database forum, but anyway,
I am using Win32::ODBC to gather data from a database:
$search = "ACT";
$stmt = "select $search from states";
$db -> Sql($stmt);
($ErrNum, $ErrText, $ErrConn) = $db->Error();
if ($ErrNum) { &errorhere("$ErrNum, $ErrText - $ErrConn, <br><br>$stmt");}
print "<hr>";
while ($db->FetchRow()) {
($states) = $db->Data("$search");
push (@state, $states);
}
In many occasions, I got NULL value inside my result, and I want to kick
them off the @state list.
What I have to do??
I tried before:
unless ($states != " ") {push (@state, $states);
and I still got NULL value inside the list <hiks>.
TIA.
TPK.
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl
