I'm having a problem with setting a variable path for putting data into my table. This is how i build my path:
SET @path1 = CONCAT('C:/Projekte/Metrics/DXL_CSV_EXPORT_DATA/', YEAR(NOW()), '_', MONTH(NOW()), '_', DAY(NOW()), '%', '/_','BeMiko/');`
Every day another Folder is created on the server. I want to automatically import the information from the .csv files from inside these folders each day.
I import data from files with:
LOAD DATA INFILE
path...
IGNORE INTO TABLE table1 FIELDS TERMINATED BY ';' ENCLOSED BY '"'
LINES TERMINATED BY '<*line_end*>\r\n' IGNORE 1 ROWS;
How do i use the string inside my @path1 variable as path? Or if this is not possible: Are there other ways to solve this problem?