Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Outputting a table/recordset to a csv
Aidan Whitehall wrote:
> Forgive the beginner's Q... trawled Google groups and got this far
> (below), but it doesn't work. I'm just trying to output a recordset to a
> text file. Ideally, I'd like the whole table but the examples that turned
> up specified the column names.
You unfortunately need to code in all the column names and column separators and also include enclosed quotes where needed...
> Anyone care to point out the stupid mistake(s) I'm making? I've no idea
> what the first seven lines do, BTW. Thanks.
<snipped>
Karsten explain it very well. You can also look at the SQL*Plus manual for more info. This is usually available via PDF or HTML with the Oracle installation.
> select st_site_id || ',' || ow_owner_id || ',' || hsg_assessment_date
> from hsg146;
This statement seems fine. What is the error that you got? What does the content of the "C:\temp.csv" has to say?
-- BillyReceived on Tue Oct 22 2002 - 00:53:06 CDT