I have a case to import data into mysql automatically every 6 pm. the imported data is "data.txt".
I created in mysql like this:
CREATE EVENT EVENT_NAME ON SCHEDULE EVERY '18: 00:00 'DAY DO LOAD DATA LOCAL INFILE 'd :/ data.txt' INTO TABLE table_name FIELDS terminated BY ',' LINES terminated BY '\ n' (atribut1, atribut2, atribut3);
if I just write like this:
LOAD DATA LOCAL INFILE 'd :/ data.txt' INTO TABLE table_name FIELDS terminated BY ',' LINES terminated BY '\ n' (atribut1, atribut2, atribut3);
the request was successfully completed
but if I write code that resembles fist code, instead the error "LOAD DATA is not allowed in stored procedures" occurs. is it really so if so, how can I handle such cases? thank you in advance sorry for my bad english
source share