SITE SEARCH

Google
 

Wednesday, May 14, 2008

MYSQL LOAD INFILE EXPORT OUTFILE

Syntax and Example


LOAD DATA LOCAL INFILE '/home/kk/EHRMSList.csv'
INTO TABLE EMP
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(SNO,EID,NAME,DEPT);

SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM test_table;

No comments: