in reply to Re: Return results of UPDATE statement
in thread Return results of UPDATE statement

Sorry for not making that clear. When you run the update statement you get something like the following.

Query OK, 1 row affected, 1 warning (0.01 sec)

Thats actually from an INSERT statement but it's very similiar. I'm looking for a way to get that output either to a screen or file. The errstr dosen't have anything in it when I print it.

  • Comment on Re^2: Return results of UPDATE statement

Replies are listed 'Best First'.
Re^3: Return results of UPDATE statement
by moritz (Cardinal) on Oct 12, 2009 at 12:06 UTC
    This string is generated by the mysql command line client, and since you don't use it, you have to construct it yourself.

    I think you can obtain the number of affected rows as the return value of $dbh->execute (but please check the documentation first), the time difference is easily computed by invoking time before and after the query, use Time::HiRes get sub-second resolution.

    Perl 6 - links to (nearly) everything that is Perl 6.
Re^3: Return results of UPDATE statement
by cdarke (Prior) on Oct 12, 2009 at 14:01 UTC
    You can get the number of rows affected by the previous statement using
    $sth->rows();
    where $sth is the statement handle.