Hi, I already have the solution to this, thanks. Thanks to Raj Jamadagni<https://plus.google.com/u/0/107377698524988211109?prsrc=4>for providing the answerI had to change the query to read like this: l_query varchar2(32000):='select redo_gen_format(b.inst_id, b.sid, b.serial#, b.username, b.machine, b.osuser, b.status, round(a.value/1024/1024)) as my_row from sys.gv_$sesstat a, sys.gv_$session b where a.statistic#=175 and a.inst_id=b.inst_id and a.sid=b.sid '; It just not something I have had occasion to do much with. On Thu, Dec 27, 2012 at 2:16 PM, Sayan Malakshinov <xt.and.r@xxxxxxxxx>wrote: > Hi, Andrew! > > Here is example of this: > (formatted - https://gist.github.com/4391444 ) > Some additions: > 1. I created this without nds, but if needed you can use "execute > immediate" instead of declared cursor > 2. You can change cursor to parameterized one > 3. I'm not sure that there is needed "bulk collect", as a function is > pipelined, maybe would be better to fetch with limits > > create or replace package pkg_redo_gen as > cursor c is > select > b.inst_id, > b.sid, > b.serial#, > b.username, > b.machine, > b.osuser, > b.status, > round(a.value/1024/1024) redo_mb > from > gv$sesstat a, > gv$session b > where > a.statistic#=175 > and a.inst_id=b.inst_id > and a.sid=b.sid; > > <SNIP> <%2B7%20903%20207-1576> > -- Andrew W. Kerber 'If at first you dont succeed, dont take up skydiving.' -- //www.freelists.org/webpage/oracle-l