At 3:28 PM +0900 6/17/01, Batara Kesuma wrote:
>I read in DuBois's MySQL, Perl DBI API Reference part, it is written:
>$rv = $sth->rows();
>Return the number of rows affected by the statement associated with $sth
>or -1 if an error occured. This method is used primarily for statements
>that do not return rows. For SELECT statements, you should not rely on the
>rows() method; count the rows as you fetch them instead.
>My question is, why we should not rely on $sth->rows()? Does it mean that
>it doesn't match sometime? Anybody ever experienced?
It's not guaranteed to work. It's not portable.
In practice, it seems to work fine for MySQL. The warning is there
so that you can't blame DBI if you rely on rows() and one day find that
it fails. :-)
>Also, in the case of "ERROR 1114: The table 'SQL22e0b00_0' is full". I
>found that this function returned -2 instead of -1.
Paul DuBois, paul@stripped