adspace
How do I spool to a csv formatted file using sqlplus?
Answer Posted / Amar Gupta
"To spool a CSV formatted file in SQLPLUS, use the following command: `SPOOLOFF` (to turn off spooling) and then create a new file with `SPFILE <filename> SET TERMOUT OFF`; after executing your query, you can redirect output to the created file using `SPool <filename>.csv`. For formatting CSV, use `CHR(10)` for line breaks. Here's an example:
```sqln
SPOFF;n
SPFILE myfile SET TERMOUT OFF;n
SELECT column1 || ',' || CHR(10) || column2 || ',' || CHR(10) FROM your_table;n
SPOOL myfile.csv;"
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Design database draw er diagram for a certain scenario ?
How to start an oracle instance?
How to use values from other tables in update statements using oracle?
What is oracle latest version?
Please send me Informatica 8.1 certification dumps, my mail id mona85gupta@gmail.com
How to put more than 1000 values into an oracle in clause?
How to write a left outer join with the where clause in oracle?
How to select all columns of all rows from a table in oracle?