views:

149

answers:

2

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 error 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
+1  A: 

Use LOAD DATA INFILE instead of BULK INSERT

Mitch Wheat
Worked like a charm.Thank you!
A: 

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

Damodharan R