Re: How can I learn what lines, in a csv file, were skipped by a LOADDATA LOCAL INFILE?
On May 8, 5:23*pm, "Paul Lautman" <paul.laut...@btinternet.com> wrote:
> Ted wrote:
> > So, how can I find out about all these warnings that came from a
> > single load statement, and how can I find out the details of what
> > lines were skipped?
>
> The answer to that depends on how you wrote your script
Actually, for this, the results I saw were from a test of one line of
code submitted directly into the mysql client. Once it is correct,
then it will be added to a SQL script (which will ultimately have only
two statements, each of which loads data from one of two CSV files.
The SQL statements are specifically routine LOAD DATA LOCAL INFILE
statements, with the usual fields terminated by, lines terminated by
clauses, each referring to specific columns in a specific table.
Maybe I have been lucky, but in all the time I've done bulk data
loading, this is the first time I received a result indicating some
records were skipped. I found, hours after I posted, that SHOW
WARNINGS; will give me the warnings, but that told me nothing about
the records that were skipped.
The master script, that will ultimately invoke the short SQL script is
written in Perl, but I don't want to do much with the DB directly from
Perl since the perl interface to MySQL seems unreliable. For example,
while I can make prepared calls to trivial select statements, I have
yet to get a Perl prepared statement (using DBI) to successfully
execute a stored procedure. I am so frustrated with that interface,
I'd rather just have perl spawn a child process, passing my SQL script
to the mysql client.
Thanks for your time.
Ted
|