default values do not set in MySQL database
Posted: Wed Jun 25, 2003 2:03 am
Hi Everyone,
I am using LOAD DATA INFILE to import a csv data file to MySQL. I would like to leave some fields blank in the csv file in order to save users' typying, and let MySQL to set the default values to those fields when loading the data. Now, every thing is OK except the default values do not set after loading the data. Those fields remain blank.
According to MySQL's manual, it should work. I have tried every thing I could think following the manual, but still can not find the problem. I am hoping some one here could help me. The following is sql query string I used:
I also tried to use PHPMyAdmin to load the csv file. I have the same problem. Do I need to configure any thing in order to set the defaults automatically.
Your help is highly appreciated.
Thanks in advance.
Ruth
I am using LOAD DATA INFILE to import a csv data file to MySQL. I would like to leave some fields blank in the csv file in order to save users' typying, and let MySQL to set the default values to those fields when loading the data. Now, every thing is OK except the default values do not set after loading the data. Those fields remain blank.
According to MySQL's manual, it should work. I have tried every thing I could think following the manual, but still can not find the problem. I am hoping some one here could help me. The following is sql query string I used:
Code: Select all
LOAD DATA LOCAL INFILE '' file '' REPLACE INTO TABLE table
FIELDS TERMINATED BY ''terminator'' ENCLOSED BY ''"''Your help is highly appreciated.
Thanks in advance.
Ruth