Well I did something like what you are talking something like this: I had DBF table and then turn it into CSV and then load the data to MySQL. the code is something like this:
my $dbhX3 = DBI->connect('dbi:XBase(RaiseError=1):'); my $dbhC3 = DBI->connect('dbi:CSV(RaiseError=1):'); my $select3 = $dbhX3->prepare("SELECT * FROM r510"); print "\nEjecutar SELECT de r510\n"; $select3->execute(); $dbhC3->do("CREATE TABLE r510.csv AS IMPORT(?)",{},$select3); print "\nconectar al a base de datos en Mysql\n"; my $mysql_dbh3 = DBI->connect("DBI:mysql:database=$datafilename;host=l +ocalhost", "root", "xyz123", {'RaiseError' => 1}); #---- Here I empty the table in MySql ------ print "Limpiando la tabla\n"; $mysql_dbh3->do("TRUNCATE TABLE r510"); #---- Here I load all the data ------- my $sql3 = "LOAD DATA LOCAL INFILE 'c:/proyecto/r510.csv' INTO TABLE r510 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n'"; my $sth3 = $mysql_dbh3->prepare($sql3); print "ejecutando la carga de la tabla\n"; $sth3->execute ();
and the error message is that of having extra characters on the line O'Neil or O"Neil stuff like that check the CSV's

In reply to Re: loading csv files into MySQL databse by padawan_linuxero
in thread loading csv files into MySQL databse by zimvoter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.