开发者

BULK INSERT problem in MySQL

开发者 https://www.devze.com 2022-12-30 03:47 出处:网络
I get an error with the following SQL command for bulk insert. BULK INSERT libra.faculty FROM \'d\\:faculty.csv\'

I get an error with the following SQL command for bulk insert.

    BULK INSERT libra.faculty
    FROM 'd\:faculty.csv'
    WITH
    (
        FIELDTERMINATOR = ',',
        ROWTERMINATOR = '\n'
    );

Here's the error message:

    ERROR 1064 (42000): You have an e开发者_开发问答rror in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near 'BULK
    INSERT libra.faculty
    FROM 'd:\faculty.csv'
    WITH
    (
    FIELDTERMINATOR = ',',
    RO' at line 1


Use LOAD DATA INFILE instead of BULK INSERT


LOAD DATA INFILE 'd:faculty.csv' INTO TABLE libra.faculty FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'

0

精彩评论

暂无评论...
验证码 换一张
取 消