Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Placeholders and Negative Numbers..

by jZed (Prior)
on Dec 11, 2007 at 17:17 UTC ( #656434=note: print w/ replies, xml ) Need Help??


in reply to Placeholders and Negative Numbers..

From the DBI documentation for $sth->rows():

Generally, you can only rely on a row count after a non-SELECT execute (for some specific operations like UPDATE and DELETE), or after fetching all the rows of a SELECT statement. For SELECT statements, it is generally not possible to know how many rows will be returned except by fetching them all.
So $sth->rows() is, by definition, the wrong thing to use with SELECT statements and is not guaranteed to give you the answer you expect. Do as the docs say and count the fetches or else do a separate COUNT query.


Comment on Re: Placeholders and Negative Numbers..

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://656434]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (13)
As of 2014-12-18 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (61 votes), past polls