Hello
I am using LOAD DATA INFILE to load data into a table.
This is how the table is defined:
CREATE TABLE people (
ID INT UNSIGNED NOT NULL AUTO_INCREMENT,
Name VARCHAR(255) NOT NULL,
Address VARCHAR(255) NOT NULL,
PRIMARY KEY (ID)
) ENGINE=MYISAM DEFAULT CHARSET=latin1;
I have 2 questions:
1) What value should be written in the file to represent a placeholder for the ID (it is an AUTO_INCREMENT attribute)?
2) Do I need to enclose strings (Name & Address attributes) with quotes?
thanks
using AUTO_INCREMENT with LOAD DATA INFILE
Moderator: General Moderators
-
davidklonski
- Forum Contributor
- Posts: 128
- Joined: Mon Mar 22, 2004 4:55 pm
1) Try '' ( thats two ' )
2) You should. Take a peek on: http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html and " FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\'' " to meantion some goodies. It's wise to use.
2) You should. Take a peek on: http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html and " FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\'' " to meantion some goodies. It's wise to use.