Nyana22
asked on
using : LOAD DATA INFILE in MySQL
Hello,
I want to load data from a csv file to a MySQL table,
I want to perform this operation within a Stored Procedure.
I tried :
LOAD DATA INFILE,
but i have an error saying that i cannot use LOAD DATA from a Stored procedure.
Do I have any alternative method that i can use in a Stored procedure?
thanks
I want to load data from a csv file to a MySQL table,
I want to perform this operation within a Stored Procedure.
I tried :
LOAD DATA INFILE,
but i have an error saying that i cannot use LOAD DATA from a Stored procedure.
Do I have any alternative method that i can use in a Stored procedure?
thanks
ASKER
Hello,
well thanks for your suggestion,
but what do you mean by variable?
is it a temporary table?
can you please give more detail about the loop,
thanks
well thanks for your suggestion,
but what do you mean by variable?
is it a temporary table?
can you please give more detail about the loop,
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SET @file := LOAD_FILE('path/to/file.cs
while LOCATE('\n', @file) do...
It will be much slower than LOAD DATA INFILE would be.