http://qs321.pair.com?node_id=92470


in reply to DBI::rows

I believe the $sth->execute method returns the number of rows or -1 if no rows affected.
You may also want to try the $sth->rows method.

Replies are listed 'Best First'.
Re: Re: DBI::rows
by Maestro_007 (Hermit) on Jun 29, 2001 at 01:34 UTC
    In the leopard book (O'Reilly's DBI book), p. 223, it says that $sth->execute() only returns the number of rows affected by non-SELECT statements. In SELECT statements it "simply returns a true value".

    MM

Re: DBI::rows (boo)
by boo_radley (Parson) on Jun 29, 2001 at 17:01 UTC
    Centaurus writes :
    I believe the $sth->execute method returns the number of rows or -1 if no rows affected. You may also want to try the $sth->rows method.
    These methods are unreliable in some databases -- they may only return an accurate count if all the rows have been read.