import a text file into a temporary table using 'Load data infile' in a stored procedure- MySQL

Posted by Pankaj on Stack Overflow See other posts from Stack Overflow or by Pankaj
Published on 2010-05-10T11:41:12Z Indexed on 2010/05/10 11:54 UTC
Read the original article Hit count: 194

Filed under:

I need to import a text file into a temporary table and from that select portions of it to insert in different tables. I wanted to use 'LOAD DATA INFILE'.

Is there any way, i can use 'Load data infile' in a stored procedure. I am using mysql.

LOAD DATA LOCAL INFILE 'C:\\MyData.txt' INTO TABLE
tempprod fields terminated by ',' lines terminated by '\r\n';
SELECT * FROM product p;

© Stack Overflow or respective owner

Related posts about mysql