Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: newbie: simple sql query to create .csv file for excel import
Volker Peter wrote:
> Hello you all out there,
>
> i'm new with Oracle SQL programming and i have a simple SQL Question:
>
> I must run a select statement on my Adress-Table and write down this
> data to a .csv file for importing this into winword or excel for working
> with that data.
> I read some documentation about Oracle Export but this seems to me that
> this won't work as i expected it to work. If you have any comments or
> ideas regarding this problem, please let me know - also if there is a
> internet website or a usergroup website where some example coding is
> shown to me so that i can learn from that sql code.
>
> If you have any ideas please let me know.
>
> Thank you !
>
> Volker
As far as I know, you have two different solutions :
spool results.csv
select a||','||b from table_1;
2) Use PL/SQL Programming with the package UTL_File to write anything you want in a file.
Example :
declare
cursor query is
select a,b from table_1;
begin
Hope it helps.
Sebastien. Received on Thu Aug 12 1999 - 06:49:51 CDT
![]() |
![]() |