Hello.
Looks like LOAD DATA INFILE supports only string constants in its syntax. I think it has sense, because security risk grows, when we can substitute variables in the file name. Scott Klarenbach <[EMAIL PROTECTED]> wrote: > I can't seem to make the Load Data statement work inside of a stored > procedure. > > ie > > LOAD DATA LOCAL INFILE "file.txt" INTO my_table > > this works fine in PHP, but when I use it in a procedure, and pass in > the file name as a parameter, it won't compile. > > LOAD DATA LOCAL INFILE fileParameter INTO my_table > > I think it's because the statement requires the file to be in quotes, > but if I concatenate the parameter into quotes, then it looks for the > EXACT variable string, not the file. > > ie LOAD DATA LOCAL INFILE ' +fileParam+ ' INTO my_table --this returns > an error saying it can't find the file "fileParam" :-). > > I also tried creating a prepared statement and then executing it USING > my file parameters, but no luck either. > > Thanks. > Any help is appreciated. > -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.NET http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Gleb Paharenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]