NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] wrote:
 
>       I am working on a script that parses a csv file.  The actual
> field delimiters in the file are pipes |.  The problem I am running into
> is that if the field is empty, then the database is getting a '0' rather
> than 'NULL' as it should.  The column is setup properly with NULLs
> allowed and the default value of NULL.  Here is a sample of the file
> being parsed...
> 
> SANDBOX|0|750|0.0|junk|N|0.0|9000/800/RP7410|Unknown|B.11.11|junk|junk|s
> erial number|Sandbox|hostname|0||CHTSAN|UNKNOWN|ROBERT C|JONES SR.|
> 
>       The problem on this line is the field between '0' and 'CHTSAN'.
> This ends up as a zero in the database.  When I parse the file again to
> compare the values, this comes up as a mismatch when it should actually
> be a match.  How do I fix this?  Thanks in advance for any help.  Here
> is the pertinent code.

You need to figure out how the value in the database is getting set to 0
rather than to NULL.  You should be looking at the code that parses the file
and inserts into the database, not the code that compares the values later.

Ronald


Reply via email to