<color><param>0100,0100,0100</param>Hello Jeremy, list,
I asked:
> After a select .. insert .. the mysql client returns something like:
> Query OK, 11393 rows affected (0.47 sec)
> Records: 11393 Duplicates: 0 Warnings: 0
>
> Is it possible in perl/DBI to fetch the count of duplicates and warnings,
> or even the time that the query took to process?
>
Jeremy Zawodny answered:
> The timing is done by the client (I'm pretty sure), so you might want
> to use Perl's Time::HiRes module to figure out how much time has
> elapsed.
Thanks for the suggestion.
>
> I also recall hearing that there are plan on the drawing board for
> making it easier to programmatically access warnings and errors after
> batch inserts.
>
Well, if even Jeremy does not know an answer, it is time to RTFM..
I started with the description of the c-api, where I found mysql_info(),
that returns the extra info as a string, if called immediately after a
Load data infile, Insert .. select .., or Update...
>From there I read the DBD::mysql docs, where I found:
$infoString = $dbh->{'info'}; this corresponds whith the c-api function.
And yes, after a load data infile .. I found that:
print "$filenm, $dbh->{'info'}\n";
returns:
mydatafile, Records: 93337 Deleted: 0 Skipped: 0 Warnings: 93337
There must be some regex guru out there to convert this type of string to
a proper hash, but for the moment I am quite happy with this solution.
Regards, Paul
<nofill>
Paul B. van den Berg email: [EMAIL PROTECTED]
Department of Social Pharmacy and Pharmacoepidemiology
University Centre for Pharmacy tel:31-50-3633331 fax:31-50-3632772
Ant. Deusinglaan 1 9713 AV Groningen Netherlands
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php