Get a block of rows
Date: 10 Mar 2003 04:10:50 -0800
Message-ID: <fa624200.0303100410.5b62d489_at_posting.google.com>
Hi to all,
my problem is the following:
I have a table: "adresses" (ID, type, firstname, lastname).
There's a primary key on ID and an index on (type, lastname).
I want to get all addresses "where type like 'customer' order by
lastname"
But I need a possibility to select only a block of
customer-addresses (e.g. 1..20, 21..40, 41..60, ...).
In other words, I need a possibility to get row n..m from the table
"addresses"
using the index (type, lastname).
I tried to use the "between" or the "Minus" operator.
With small numbers of n it worked fine, but when the number grow
bigger it took
to much time (because I have to execute this select-statement almost
every second).
I think with the "between" and the "Minus" operator, Oracle always
creates a new cursor with many results although I only need 20 rows.
Of course I need to have the possibility to jump backwards to a former block which I already the read before, so it's not just some fetch-statements in the cursor.
If you have any idea or suggestions, please let me know.
Thanks in advance.
Ralf
Received on Mon Mar 10 2003 - 13:10:50 CET