I'm trying to run this query from a .Net application
LOAD DATA LOCAL INFILE 'testsFile.txt'
INTO TABLE Test
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(idTest, SampleID, Analyst, @Analysed, Device, Comments, @TotalRUL, @RULOne, @RULTwo, @RULThree, @RULFour, Uploaded)
SET
Analysed = nullif(@Analysed,''),
TotalRUL = nullif(@TotalRUL,''),
RULOne = nullif(@RULOne,''),
RULTwo = nullif(@RULTwo,''),
RULThree = nullif(@RULThree,''),
RULFour = nullif(@RULFour,'')
When I run this query from MySQL Workbench everything works fine, but when I use my .net application to run the query I get the following exception:
Parameter '@Analysed' must be defined.
I don't think I can use a declare statement outside of a stored procedure and I cant use a stored procedure due to my use of the LOAD DATA statement
What to do? Is this checkmate?