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

Home -> Community -> Usenet -> c.d.o.server -> Re: Convert Oracle data to EXCEL

Re: Convert Oracle data to EXCEL

From: Luggy <dgh_consulting_at_my-deja.com>
Date: Thu, 14 Dec 2000 13:50:45 GMT
Message-ID: <91aj7i$mto$1@nnrp1.deja.com>

Dmitry,

Fair point about data containing commas, but the output from the script below IS strictly CSV format. What happens when you've got doublequotes  in your data? This would screw up your solution.

My PL/SQL script (the one I referred to) wraps each column with the encapsulator of your choice (double-quotes, or whatever else you may prefer). Note that the only encapsulator Excel seems to like is the double-quote (as Dmitry correctly specified), when opening a file as a CSV. Dave.

In article <91advl$is2$1_at_nnrp1.deja.com>,   dmalto_at_my-deja.com wrote:
>
>
> It's not CSV format, because data can contain ','
> and in CSV format this column enclosed by " ",
> Moreover data can contain " so in CSV format it
> duplicated.
> Example:
>
> column data CSV format
> ----------- ----------
> aaaa aaaa
> bbb,b "bbb,b"
> ccc"c "ccc""c"
>
> To convert data to CSV format use tool:
> http://www.simtel.net/pub/simtelnet/win95/database/chyfo171.zip
> (version 1.7.1, 30k size, platform Win95/98/NT/2000)
>
> Best regards, Dmitry
>
> In article <91a3ra$brr$1_at_nnrp1.deja.com>,
> Luggy <dgh_consulting_at_my-deja.com> wrote:
> > Hi Amy.
> >

 ...
> >
> > To make a CSV (option 3) for the following table...
> >
> > ATABLE
> > COL_A DATE
> > COL_B VARCHAR2(10)
> > COL_C NUMBER(5)
> >
> > ...you could use the following script in SQL*Plus...
> >
> > ------------------------cut--------------------------
> > set linesize 32767
> > set trimspool on
> > set termout off
> > set pagesize 0
> >
> > spool atable.csv
> >
> > select COL_A||','||COL_B||','||COL_C
> > from atable;
> >
> > spool off
> > ------------------------cut--------------------------
> >
> > To create the above file dynamically for multiple tables, I have
> > written a PL/SQL script. Please let me know if you'd like this (I
 can
> > email it if so).
> >
> > HTH,
> >
> > Dave Henderson.
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
> Sent via Deja.com
> http://www.deja.com/
>

--
Any opinions expressed in the above posting are entirely factual and obj
Please do not argue with me, as my Dad is bigger than your Dad.


Sent via Deja.com
http://www.deja.com/
Received on Thu Dec 14 2000 - 07:50:45 CST

Original text of this message

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