I'm getting some odd behaviour from the 'load data' command which I can't resolve. For some reason, 'load data' is putting a quotation at the end of the first column of the table

Here is my table definition:

create table if not exists Ref
(ref_name varchar(30) not null,
ref_org varchar(30) not null,
ref_title varchar(30) not null,
ref_email varchar(30) not null,
ref_phone varchar(30) not null,
ref_calltime varchar(30) not null,
primary key(ref_name),
index r_pk (ref_name)
) Type=InnoDB;


Here is my 'load data' statement:

load data infile '/home/rhino/MySQL/Ref.asc'
replace into table Ref
fields terminated by ';'
optionally enclosed by '"'
escaped by '\\'
lines starting by '"'
terminated by '\n';

Here is an excerpt of my data file:

"Joe Blow";"ABC Inc.";"CEO";"[EMAIL PROTECTED]";"(212) 555-1212 (office)";"call anytime" "Fred Smith";"DEF Corp.";"CFO";"[EMAIL PROTECTED]";"(213) 555-9999 (home)";"call evenings"

Here is what I get when I display the contents of the table via a Select *:

Joe Blow" ABC Inc. CEO [EMAIL PROTECTED] (212) 555-1212 (office) call anytime Fred Smith" DEF Corp. CFO [EMAIL PROTECTED] (213) 555-9999 (home) call evenings

For some reason, 'load data' is putting a quotation, i.e. a ", at the end of each value in the first column of the table, e.g. Joe Smith" instead of Joe Smith. If I load the same data with Insert statements rather than 'load data', the result is identical except that the trailing quotation mark at the end of each name in the first column is absent, which is precisely as it should be.

I'm trying to populate this table with 'load data' if possible - it's more convenient than having to write the Insert statements - but I keep getting the unwanted quotations when I do it that way despite trying umpteen variations. Does anyone know why 'load data' is insisting on putting this quotation in each row?

I don't have that same behaviour in other very similar situations in which the table definition, the 'load data' statement and the organization of the data file is comparable.

I can't find anything on this problem in the manual or the archive of all the mailing lists....

I'm running MySQL 4.0.15'-Max'.

---
Rhino



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.18/230 - Release Date: 14/01/2006


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to