Hi,

I have a table in Oracle.

Here is the table.

SQL> select * from test;

       SDI NAME
---------- ---------------
       123 Tapas
       345 PradEEp
       567 Jagadish
       789 Giri

I want write this data into a CSV file. I tried this but i am not able to redirect or write to the file.

Here is the Query.

SELECT name INTO OUTFILE "/orahome/test.csv" from test;
Error:
ORA-00923: FROM keyword not found where expected

How can i write the data to file or redirect the data to file in Oracle?

Regards

try this

SQL> spool c:\test.txt
SQL> SELECT * FROM test;
SQL> spool off
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.