MySQL Forums
Forum List  »  Perl

Re: load data infile
Posted by: Randy Clamons
Date: July 20, 2010 02:15PM

According to the reference manual, "The filename must be given as a literal string", so, no, it can't be done in a stored procedure unless the filename is always the same. That doesn't seem likely.

In your Perl script, assign the input file name to a variable, then have Perl interpolate that string when you submit the command.

my $filename = 'file1.ext';
my $sql = "LOAD DATA INFILE '$filename' ....";

Options: ReplyQuote

Written By
July 20, 2010 01:46PM
Re: load data infile
July 20, 2010 02:15PM
July 20, 2010 02:25PM
July 20, 2010 03:39PM
August 30, 2010 01:26PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.