MySQL Forums
Forum List  »  Newbie

Null values are replaced with zeros in infile.
Posted by: Sudheendra Walvekar
Date: December 08, 2011 05:53AM

Hi,

I have been trying to use infile to import data from a csv file into MySQL table.The columns in MySQL table are defaulted to null.

The csv file contains blank or null values in some of the columns. The code looks as below.

LOAD DATA LOCAL INFILE 'C:/orders.csv'
INTO TABLE order
FIELDS TERMINATED BY ','
ESCAPED BY '\'
LINES TERMINATED BY '\n' IGNORE 1 LINES

Though the import is successful, I see zeros instead of blank or Null in the corresponding columns in the table in MySQL. I need the values appearing as Null if the corresponding value in csv file is blank.

I would appreciate any help.

Regards

Sudheendra

Options: ReplyQuote


Subject
Written By
Posted
Null values are replaced with zeros in infile.
December 08, 2011 05:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.