Re: This is a question about the concatenation symbol "||"

From: Chris <cs123._no_spam__at_telstra.com>
Date: Sat, 03 Jul 2004 21:59:31 GMT
Message-ID: <7%FFc.77165$sj4.46662_at_news-server.bigpond.net.au>


"Ole Hansen" <ohahaahr_at_hotmail.com> wrote in message news:3d05b5c1.0407031022.3ff1205b_at_posting.google.com...
> Hi,
>
>
> This is a question about the concatenation symbol "||"
>
> If i write this statement: "select
> empno||','||ename||','||job||','||hiredate from emp;"
>
> I get this output:
>
> 7369,SMITH,CLERK,17-DEC-80
> 7499,ALLEN,SALESMAN,20-FEB-81
> 7521,WARD,SALESMAN,22-FEB-81
> 7566,JONES,MANAGER,02-APR-81
> 7654,MARTIN,SALESMAN,28-SEP-81
>
>
> If i write this statement: "select *|| from emp;"
>
> I get an error.
>
>
> The reasen why a want to write "select *||" is, that I have a table
> with more than 200 fields, and I need to export them all to a
> csv-file. I don't want to write "field1||','||field2||',' ..." for all
> 200 fields.
>
> Is there a smart way to do this ???
>
> I use SQLPlus on Oracle 9i.
>
>
> Regards,
> Ole

in sqlplus

set colsep ','
set heading off
set pages 0
spool my_file
select * from my_table;
spool off Received on Sat Jul 03 2004 - 23:59:31 CEST

Original text of this message