sql - Result from pipelined function, always will sorted as "written", or not? -
needed renumbered result set, example:
create or replace type nums_list table of number; create or replace function generate_series(from_n integer, to_n integer, cycle_max integer) return nums_list pipelined cycle_iteration integer := from_n; begin in from_n..to_n loop pipe row( cycle_iteration ); cycle_iteration := cycle_iteration + 1; if cycle_iteration > cycle_max cycle_iteration := from_n; end if; end loop; return; end; select * table(generate_series(1,10,3)); question is: there guarantee, oracle return result in order? :
1 2 3 1 2 3 1 2 3 1
or maybe result unexpected ordered, this:
1 1 1 1 2 2 ....
?
pipelining negates need build huge collections piping rows out of function created, saving memory , allowing subsequent processing start before rows generated
this means, start processing rows before fetched , that's why seeing unpredictable order.
Comments
Post a Comment