Re: pl/sql function help

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Fri, 10 Jan 2003 08:15:31 -0800
Message-ID: <3E1EF1A3.88935447_at_exesolutions.com>


sdm wrote:

> I'm new to SQL and brand new to PL/SQL. I probably would not have ventured
> into PL/SQL except that in a report I'm writing I discovered that I will
> need to write a PL/SQL function that will retrieve items and return them as
> a comma-separated values list. I've been searching the Oracle books online
> and I have a copy of Oracle Press' PL/SQL 101 but I can't find a good
> example of how to do this. I'd like to see not just the syntax of how to
> write, but also see a real-world example.
>
> A 2nd problem with this is that, in the comma separated list, I want to see
> POs (purchase orders) for certain SKUs but only when the SKUs have a certain
> sort code. This info is in 2 different tables and no examples I've seen show
> how to query from more than one table.
>
> Can someone help me or at least point me towards a reference that is going
> to help me learn what I need to learn? Thanks!

RajXesh's answer is a good one. If the items you are putting into the list are all 30 characters or less in length look at the Oracle built-in package procedure DBMS_UTILITY.TABLE_TO_COMMA.

For a place to look all of this stuff up and get hints look at: http://tahiti.oracle.com
http://asktom.oracle.com

Daniel Morgan Received on Fri Jan 10 2003 - 17:15:31 CET

Original text of this message