Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by Arunbear (Prior)
on Jul 21, 2021 at 11:28 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found