Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Split records

by dafi (Initiate)
on Feb 19, 2004 at 08:54 UTC ( [id://330175]=perlquestion: print w/replies, xml ) Need Help??

dafi has asked for the wisdom of the Perl Monks concerning the following question:

Hi...can anyone tell me how can I split the record on more pages? I have more then 1000 records and I want to put only 10 on page...how can I do that? I use oracle database

Replies are listed 'Best First'.
Re: Split records
by jarich (Curate) on Feb 19, 2004 at 09:19 UTC
    Welcome to the monastery dafi!

    There are some things you should know before you get really settled in here. Many of us here really want to help you out, we're very eager in fact. However we can't read your mind so we'll need you to tell us lots of things that are relevant to the problem.

    If you want a good idea of what we want from you, check out the Welcome to the Monastery tutorials. These cover lots of useful hints on how you can help us help you, and then later, how you can help us help us.

    Now with respect to your specific problem I suspect the answer your looking for is to use LIMIT and OFFSET. The exact way to use these depend on your database. I've never used Oracle so I can't tell you exactly.

    It's probably something like this though:

    select username, firstname, surname from users limit 10 offset 20;
    This will give you numbers 21-30.

    Please read over the tutorials, it'll make your experiences here much more enjoyable.

    Hope this helps,

    jarich

      It's probably something like this though:
      select username, firstname, surname from users limit 10 offset 20;
      This will give you numbers 21-30.
      Yeah, except that if you change offset to 150, you might get the same results. In a different order. You do need to order your results to have some chance of a meaningful result. And just pray that between invocations, noone deleted or added records.

      Abigail

Re: Split records
by larsen (Parson) on Feb 19, 2004 at 09:13 UTC
    I think the solution could be split in two parts: to paginate the results, you can use Data::Page. To fetch only the data you're interested to from Oracle, you have to implement a LIMIT mechanism, which isn't available in Oracle, AFAIK.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-18 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found