-
how to export the reusult of a query to a comma delimited data file? can anyone give me an example? It would be better if the output file has the table column names in the first row.
thanks.
-
set echo on
spool &where_to_put_this_output;
select field1||', '||field2||', '||field3 from mytable;
spool off;
-
kmesser,
I am adding one more line to your code
set heading off
set echo on
spool &where_to_put_this_output;
select field1||', '||field2||', '||field3 from mytable;
spool off;
sree
-
I would also add:
set feedback off
-
If we are going for the set, and substitution variables are used in the code, then
SET VERIFY OFF
might also be useful.
HTH
David.
-
You can also use
SET COLSEP ,
if you have lots of columns to concatenate using ||
-
The query will be faster if
SET TERMOUT OFF
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|