Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: SQLite: how to get a number of rows from SELECT query

by Arunbear (Prior)
on Jul 21, 2021 at 11:28 UTC ( #11135260=note: print w/replies, xml ) Need Help??


in reply to SQLite: how to get a number of rows from SELECT query

SQLite doesn't seem to have an equivalent of MySQL's FOUND_ROWS feature (though even that is now deprecated in MySQL).

If using DBIx::Class, is an option, it makes this kind of usage simple (at the cost of doing two queries) e.g.

my $cd_rs = $schema->resultset('CD')->search({ year => 2005 }); printf "returned (%s) rows\n", $cd_rs->count; while($cd = $cd_rs->next) { print $cd->title; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2021-10-21 21:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?