I thought about writing a simple tail -f like utility to "trace" the progress of some figures within the database:
create or replace function tail_f return varchar2_tab pipelined as
n number;
begin
loop
exit when ...
select count(*) into n from ... where ...;
pipe row(sysdate || ' n= ' || n);
dbms_lock.sleep(60);
end loop;
return;
end tail_f;
And then I'd like to select * from table(tail_f) in SQL*Plus.
In order to fetch the rows one by one, I SET ARRAYSIZE 1. Yet, the records (except the first one) are fetched in pairs.
Is there an explanation for this and how can I get the records as soon as one is piped?