Building dynamic sql that will do CSV

select 'select '''||TABLE_NAME||','||COLUMN_NAME||''', ''',''',
min('||COLUMN_NAME||'),
max('||COLUMN_NAME||') from '
||OWNER||'.'||TABLE_NAME||' where '||COLUMN_NAME||' is not null;'
FROM dba_tab_columns
WHERE table_name in

max(SAMPLE_DATE5) from HIST.CLIENT_SAMPLES where SAMPLE_DATE5 is
not null;

and an output of:

CLIENT_SAMPLES,SAMPLE_DATE5 0 11/09/2002 09:38

What I want is a "comma" between everything and perhaps ", but building this
dynamically has got my brain all fuddled. Trying to figure out what to build
in the dynamic to get the executed sql to look right... I just can't seem to
get the right combination...

--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Michael Kline
INET: mkline1_at_comcast.net
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).