Re: Select statement question

From: Ian Jacob <i-jacob_at_nimr.mrc.ac.uk>
Date: 1995/07/31
Message-ID: <3vi0mn$fhg_at_auntie.bbcnc.org.uk>#1/1


In article <3vgpgp$pbr_at_warez.psyber.com>, rcox_at_jasmine.psyber.com says...
>
>I need to pull some data out of an Oracle database with SQL. It would
 greatly
>simplify my life if, somehow, through the select statement I could
 insert
>commas and quotes in such a manner that my spool file would be a comma
>delimeted format. If this is possible please let me know.

You can achieve the same with sqlplus. Try running the example below:-

select ''''||dummy||''''||','||''''||dummy||'''' from dual

In the example '''' inserts one quote and each || concatonates the previous value to itself.

Just to add a little confusion, the following also works!

select ''''||dummy||''','''||dummy||'''' from dual

Dont ask me why - if anyone knows.... Received on Mon Jul 31 1995 - 00:00:00 CEST

Original text of this message