
scarab
Deleted
Jun 26, 2000, 8:29 AM
Post #1 of 2
(273 views)
|
|
null DB entries
|
Can't Post
|
|
I'm trying to ignore rows with a null value in the INET2 table (in the following code). The DB is MSSQL 7 (blargh) and I'm using FreeTDS and DBD::Sybase. Calling the database is great, and I can somewhat identify them with the gt ' ' eval, but I can't seem to figure out why these null values aren't exactly null. Enlighten me, scarab. -- code -- #!/usr/bin/perl use DBI; $data_source = 'dbi:Sybase:server=myip'; my $dbh = DBI->connect($data_source,'user','pass', {PrintError => 0}) | | die $DBI::errstr; my $sth = $dbh->prepare( q{ SELECT * FROM SY01200 }) | | die "Can't prepare statement: $DBI::errstr"; my $rc = $sth->execute | | die "Can't execute statement: $DBI::errstr"; while (($Master_Type, $Master_ID, $ADRSCODE, $INET1, $INET2) = $sth->fetchrow_array) { if ($INET2 gt ' ') { print "$Master_ID:\t\t$INET2\t\t($Master_Type)\n"; } } die $sth->errstr if ($sth->err); $sth->finish; $rc = $dbh->disconnect | | warn $dbh->errstr; # disconnect from the bad boy
|