0

I am using the Solaris OS. From Solaris I'm logging into SQL*Plus. My database is Oracle 9i.

I am spooling the output of my query into a file. How can I get it in CSV format so that I can copy it into Excel?

My query is like the follwing.

select name,id,location from employee;
1

1 Answer 1

1

I have found a way out of it. We can use concatenation here,

select name,id,location from employee;

gives us 2 different columns, but not in CSV format.

I did

select name||','||id||','||location from employee;

We get the output in a CSV format. It has just concatenated the output with commas (,).

Sign up to request clarification or add additional context in comments.

1 Comment

Your solution works unless you have commas located in your data. In those instances you will need to double quote the fields.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.