Re: Obtains rows 10-20 in a SELECT with ORDER BY!
From: Marcelo Guelfi <mguelfi_at_10.220.5.1>
Date: 1998/05/27
Message-ID: <356C2491.B6488C77_at_10.220.5.1>#1/1
end;
/
Date: 1998/05/27
Message-ID: <356C2491.B6488C77_at_10.220.5.1>#1/1
Fidel :
This is a way to do what are you needing.
Create a PL/SQL program that receives 2 parameters (the min row and the max row) and declare a cursor with your select. I send you a simple example:
set serveroutput on size 1000000
set feed off
set show off
set verify off
declare
min_value number;
max_value number;
cont number;
CURSOR C1 (MAX_VALUE number) IS
SELECT username
FROM all_users
WHERE rownum <= MAX_VALUE
ORDER BY username;
begin
cont:=1;
min_value:=&1;
max_value:=&2;
FOR i in c1(max_value) LOOP
if (cont >=min_value ) then
dbms_output.put_line(i.username);
end if;
cont:=cont+1;
END LOOP;
end;
/
Another way is to obtain all the output of your query and process it with a script made in perl, shell, etc.
Best Regards,
Marcelo.
MARCELO GUELFI.
IBM Uruguay.
Plaza Independencia 721, Montevideo - Uruguay.
tel : (598 2) 902 3617
(598 2) 400 6260 ext 12
Fax (598 2) 902 1144.
e-mail : mguelfi_at_acm.org
mguelfi_at_computer.org Received on Wed May 27 1998 - 00:00:00 CEST
