2008-12-08
- sql
-
-
SERVEROUTPUT ON
-
-
declare
-
result_limit number := 10;
-
current_query_no number := 1;
-
--table_n varchar2(30) := 'brian.cran1400_der_results';
-
--cursor all_results is select * from brian.cran1400_der_results;
-
cursor result_list(counter number) is select * from brian.cran1400_der_results where queryno = counter order by score DESC, docno ASC;
-
--cursor sub_list is select * from brian.cran1400_der_results where
-
--select all results from table where query number is less than 10
-
inner_min number := 1;
-
inner_max number := 10;
-
total_precision number := 0;
-
-
-
begin
-
-
for result_record IN result_list(current_query_no) loop
-
--loops through the result list in the cursor (all records 1 - 10)
-
-
for counter_one in inner_min..inner_max loop
-
-- do stuff here
-
current_query_no := counter_one;
-
-
if result_record.rn = 'R' then total_precision := total_precision + 1;
-
dbms_output.put_line (total_precision);
-
end if;
-
-
-
-
end loop;
-
end loop;
-
end;
-
-
-
-