Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Answer: How to display from X to Y records using DBI?

( #9813=categorized answer: print w/ replies, xml ) Need Help??

Q&A > database programming > How can I retrieve records X to Y using DBI? - Answer contributed by chromatic

You could use the SQL command LIMIT: SELECT * from presidents WHERE terms > 2 LIMIT 10; You can also use the DBI method fetchall_arrayref(), which will return a reference to a list of rows. Use an array slice to get at the ones you want:
# prepare and execute statement my $array_ref = $sth->fetchall_arrayref(); # we want 0 through 20 foreach my $row (@$array_ref[0 .. 20]) { # do something }

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2016-08-25 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (359 votes). Check out past polls.