I'm trying to parse an input file and then take data from that file and enter it into a MySQL database. I'm separating the fields with tabs '\t' and ending the records with a newline '\n'. I'm using the LOAD DATA function (see the code snippet below).
# Load the data into the history table
my $sql_statmnt2 = "LOAD DATA LOCAL INFILE \'$history_file \'
INTO TABLE History";
print "$sql_statm nt2 \n";
$sth2 = $dbh->prepare($sql_s tatmnt2);
$sth2->execute();
$sth2->finish();
However, I only get the first record not all of them. I've looked at the file with an editor that shows invisible characters and the tabs and newlines show up.
Thanks!
Buff
# Load the data into the history table
my $sql_statmnt2 = "LOAD DATA LOCAL INFILE \'$history_file \'
INTO TABLE History";
print "$sql_statm nt2 \n";
$sth2 = $dbh->prepare($sql_s tatmnt2);
$sth2->execute();
$sth2->finish();
However, I only get the first record not all of them. I've looked at the file with an editor that shows invisible characters and the tabs and newlines show up.
Thanks!
Buff
Comment