Try this,


print "<hr>";
while ($db->FetchRow()) {
 ($states) = $db->Data("$search");
 if ($states ne '')
        {
        push (@state, $states);
        }
}


> -----Original Message-----
> From: Toddy Prawiraharjo [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, January 15, 2001 12:27 AM
> 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
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to