Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Building temporary result set in PL/SQL
Hi. Can someone point me in the right direction on how I programatically build a result set in PL/SQL? I could insert into a temporary table and select * from that, but can I not avoid the temporary table?
I'm not quite sure what to look for in the documentation. In effect, what I'm looking for, is an alternative to the below routine, that does not use inserts, but returns the output relation.
declare
cursor c is
select /*+ FIRST_ROWS */ id, score(1) from table_a
where contains(content, '((test%)*(1/10))', 1) > 0
order by score(1) desc;
begin
for i in c
loop
INSERT INTO temp_table(id, score) ...
exit when c%rowcount > 21;
end loop;
end;
/
Thanks,
Morten Received on Mon May 13 2002 - 04:26:55 CDT