PL/SQL – Pipelined Table Function

| Posted by watashii | Filed under Oracle, Programming

Normally when writing PL/SQL functions, they return a single value result.  But what if you want to return a collection type instead?  The easiest way to do this is via a pipelined function, with the PIPELINED keyword, in which rows are returned by the function iteratively.   It can be created at the schema level, or inside a package.  I prefer the latter since its more portable, and easier to manage.

Inside the function, you return individual elements of the collection type, instead of returning the entire collection type when function ends.  This also has performance benefits, depending on your application.

Read the rest of this entry »

Tags: , , ,