Re: HOWTO: STORED PROCEDURE RETURNING MANY ROWS

From: Andreas Mosmann <mosmann_at_expires-30-06-2011.news-group.org>
Date: Tue, 21 Jun 2011 07:55:42 +0200
Message-ID: <1308635742.4_at_user.newsoffice.de>



Gunter Herrmann schrieb am 20.06.2011 in <4dffb7d7$0$7617$9b4e6d93_at_newsspool1.arcor-online.net>:

> It looks like you want to create a large set of data, so use the pipelined
> version:

Not really. This function will return something between null and 20 lines, but

> FUNCTION fun_something
> RETURN some_table_type PIPELINED
> IS
> lrec_output some_row_type;
> BEGIN
> -- some loop here

> lrec_output_row := some_row_type(something, somethingelse,
> somethingmore);
> PIPE ROW (lrec_output_row);
> -- end of loop here
> RETURN; -- note that you return nothing!
> END;

works fine.

Many thanks, you gave me the answers, I needed. I'll post the complete solution (abstracted) for others, maybe someone needs it.

Andreas

-- 
wenn email, dann AndreasMosmann <bei> web <punkt> de
Received on Tue Jun 21 2011 - 00:55:42 CDT

Original text of this message