List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:April 23 2003 5:30pm
Subject:Re: LOAD DATA INFILE command loads 0 instead of NULL for decimal fie lds.
View as plain text  
At 12:35 -0400 4/23/03, Shantharaja Channabasavegowda wrote:
>Hi All,
>I have a table of following format
>mysql> desc dealer;
>+-----------------------+--------------+------+-----+---------------------+-
>------+
>| Field                 | Type         | Null | Key | Default             |
>Extra |
>+-----------------------+--------------+------+-----+---------------------+-
>------+
>| DEALER_NUMBER         | varchar(6)   |      | PRI |                     |
>|
>| NIGHT_DROP_OFF_INDCTR | varchar(1)   | YES  |     | NULL                |
>|
>| DROP_OFF_TIME         | decimal(4,0) | YES  |     | NULL                |
>|
>| REGION_CODE           | varchar(5)   | YES  |     | NULL                |
>|
>| CLIENT_ID             | varchar(5)   | YES  |     | NULL                |
>|
>| ACTVT_CODE            | varchar(5)   | YES  |     | NULL                |
>|
>| ACTVT_DATE            | datetime     |      |     | 0000-00-00 00:00:00 |
>|
>| CLIENT_DLR_ID         | varchar(12)  | YES  | MUL | NULL                |
>|
>+-----------------------+--------------+------+-----+---------------------+-
>------+
>
>If I insert data using following INSERT statement, It will be OK.
>INSERT INTO DEALER VALUES ('213108','N',NULL,NULL,'SUZ','CG','2003-02-12
>17:46:51','213108');
>
>But if I load same data using LOAD DATA INFILE  command, it load 0 instead
>of NULL for decimal fields.
>How do I load  NULL into decimal field which is nullable.
>
>213108;N;NULL;NULL;SUZ;DL;20030422000000;213108;

Use \N, not the word NULL.

>
>Thanks in advance
>shanth

Thread
LOAD DATA INFILE command loads 0 instead of NULL for decimal fie lds.Shantharaja Channabasavegowda23 Apr
  • Re: LOAD DATA INFILE command loads 0 instead of NULL for decimal fie lds.Martin23 Apr
  • Re: LOAD DATA INFILE command loads 0 instead of NULL for decimal fie lds.Paul DuBois23 Apr
  • Re: LOAD DATA INFILE command loads 0 instead of NULL for decimal fie lds.Keith C. Ivey23 Apr
  • Re: LOAD DATA INFILE command loads 0 instead of NULL for decimal fie lds.gerald_clark23 Apr