Hi, I'm trying to import values from a text file into a mySQL database, the table I'm using is
-------
CREATE TABLE tblAllocate
(
AllocateID int not null auto_Increment primary key,
AllocatedUSer varchar(35),
AllocatedComputer varchar(6),
AllocationChecked date
);
-------
and I'm importing with:
-------
LOAD DATA LOCAL INFILE 'C:/testbed/tables/automated/out.txt'
INTO TABLE tblAllocate
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\r'
(AllocateID,AllocatedUser,AllocatedComputer,AllocationChecked);
-------
and the text file looks like:
-------
3,aaaa111,697567,\N \r
4,aaaa112,697568,\N \r
5,aaaa113,697569,2006/08/16 \r
7,aaaa114,697571,\N \r
8,aaaa115,697572,2006/08/21 \r
10,aaaa116,697574,2006/08/22 \r
-------
Now the problem is that the Null "\N" isnt working on the last col, I just get a default date of 0000-00-00 whereas I want null. those with dates in are being imported fine.
I was having a simmilar problem imporing to another table but the date was working fine but the last col would not import a null value
Any ideas what I'm doing wrong?
-------
CREATE TABLE tblAllocate
(
AllocateID int not null auto_Increment primary key,
AllocatedUSer varchar(35),
AllocatedComputer varchar(6),
AllocationChecked date
);
-------
and I'm importing with:
-------
LOAD DATA LOCAL INFILE 'C:/testbed/tables/automated/out.txt'
INTO TABLE tblAllocate
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\r'
(AllocateID,AllocatedUser,AllocatedComputer,AllocationChecked);
-------
and the text file looks like:
-------
3,aaaa111,697567,\N \r
4,aaaa112,697568,\N \r
5,aaaa113,697569,2006/08/16 \r
7,aaaa114,697571,\N \r
8,aaaa115,697572,2006/08/21 \r
10,aaaa116,697574,2006/08/22 \r
-------
Now the problem is that the Null "\N" isnt working on the last col, I just get a default date of 0000-00-00 whereas I want null. those with dates in are being imported fine.
I was having a simmilar problem imporing to another table but the date was working fine but the last col would not import a null value
Any ideas what I'm doing wrong?