Null values are replaced with zeros in infile.
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
Subject
Written By
Posted
Null values are replaced with zeros in infile.
December 08, 2011 05:53AM
December 08, 2011 08:13AM
December 09, 2011 08:49AM
December 09, 2011 09:14AM
December 09, 2011 09:17AM
December 11, 2011 01:01AM
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.