Custom Function

Unfortunately my production-db is neither 11g nor I have the WMSYS-schema installed.
But I found a pretty solution on www.oracle-base.com which you can find here. The approach uses 10g’s COLLECT-function, a table-type and a user-function to get the desired output.
This snippet is from the named article on oracle-base: