MySQL-csv insert into tables doesn't take effect
M E Fieu
sibu168 at yahoo.com
Wed Mar 16 07:26:51 UTC 2005
Hi.. I create a data.csv file using excel file and
convert to CSV as following
[root at box root]# more data.csv
departmentID,name,job
1,IT,IT-infra
2,HR,Human Resource
3,Finance,Financing
>>then I create a table 'department' with the
following
use testdb;
create table department
(
departmentID int not null auto_increment primary
key,
name varchar(30),
job varchar(30)
)
type=InnoDB;
#####################################################
but when i tried to load the CSV file into the table
department, the name and job column still shown as
NULL? Why?? Any soiution?
mysql>load data local infile '/root/data.csv' into
table department;
mysql> select * from department;
+--------------+------+------+
| departmentID | name | job |
+--------------+------+------+
| 1 | NULL | NULL |
| 2 | NULL | NULL |
| 3 | NULL | NULL |
+--------------+------+------+
3 rows in set (0.00 sec)
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
More information about the fedora-list
mailing list