Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Export to flat file from Oracle

Re: Export to flat file from Oracle

From: Christopher Beck <clbeck_at_us.oracle.com>
Date: Thu, 03 Dec 1998 22:18:00 GMT
Message-ID: <36680c08.28150197@inet16.us.oracle.com>


On Thu, 03 Dec 1998 21:26:15 GMT, mthyagaraj_at_neural.com wrote:

>Basic question:
>I'd like to know how to trim extra spaces between columns generated during
>spooled export to a flat file from a query. They are quote, comma delimited.
>

try selecting all the columns concatted together.

eg.

SQL> set feedback off
SQL> set heading off
SQL> spool aaa.sql
SQL> select '"'||empno||'","'||ename||'","'||job||'"' data from emp;


"7369","SMITH","CLERK"
"7499","ALLEN","SALESMAN"
"7521","WARD","SALESMAN"
"7566","JONES","MANAGER"
"7654","MARTIN","SALESMAN"
"7698","BLAKE","MANAGER"
"7782","CLARK","MANAGER"
"7788","SCOTT","ANALYST"
"7839","KING","PRESIDENT"
"7844","TURNER","SALESMAN"
"7876","ADAMS","CLERK"
"7900","JAMES","CLERK"
"7902","FORD","ANALYST"
"7934","MILLER","CLERK"
SQL> spool off

hope this helps.

chris.

>Thanks,
>Manohar Thyagaraj
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


--
Chirstopher Beck
Oracle Corporation
clbeck_at_us.oracle.com
Reston, VA.



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Dec 03 1998 - 16:18:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US