Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: DBD::SQLite dilemma

by adrianh (Chancellor)
on Aug 11, 2003 at 09:44 UTC ( #282803=note: print w/replies, xml ) Need Help??

in reply to DBD::SQLite dilemma

I'd go for option (3) myself and call

my $rowcount = $dbh->do("SELECT * FROM TABLE");

undefined behaviour (mainly coz I'd like iterators:-)

The benefit is worth the gain - and people should learn how to use COUNT().

Replies are listed 'Best First'.
Re: Re: DBD::SQLite dilemma
by PodMaster (Abbot) on Aug 11, 2003 at 10:13 UTC
    I second this idea (... on the other hand, maybe Matts can hack sqlite to add such functionality -- naah).

    update: `perldoc DBI' says "For SELECT statements... The execute method does not return the number of rows that will be returned by the query (because most databases can't tell in advance), it simply returns a true value.". So, since DBI users are not supposed to rely on this, they shouldn't ;)

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Indeed. It's expensive to return the count of a select because you either have to count the number of responces you get back, or run a count(*) on the same querey that you're executing, which can be as expensive as running the query itself.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2020-11-30 02:52 GMT
Find Nodes?
    Voting Booth?

    No recent polls found