2

I am trying to run the export command in SQL Developer. I get the error message "Unknown Command". Searching the web, I am told by many to run catexp.sql. I don't have that file, and I don't know how to download it. Can anyone help me run this command? How do I find catexp.sql? Using the export functionality is not a feasible option since I must run the code below about 80 times.

exp username/password direct = y file = C:\mypath\mydata.csv tables = TABLE.TABLENAME query =\"Where rownum\<=5000000\"

Thanks in advance.

Clyde
  • 21
  • 1
  • 2
  • 1
    `exp` is a commandline program, not a SQL command. You cannot run that from within any SQL client (including SQL Developer) –  Jun 06 '13 at 17:52

2 Answers2

1

exp is a commandline program, not a SQL command.

You cannot run that from within any SQL client (including SQL Developer).

Additionally exp is somewhat deprecated anyway and you should use DataPump in order to export your data.

DataPump can be accessed through SQL using the dbms_datapump package and will write the dump file into a directory on the server.

dbms_datapump is documented extensively in the manual

There are also several examples available:

  • Thanks. I don't want to write a file on the server, I want to write the file to my hard drive. Will DataPump work for that? – Clyde Jun 06 '13 at 17:59
  • @Clyde: no. DataPump can only write to the server –  Jun 06 '13 at 18:23
  • Okay. Thank you for responding to my question. I appreciate it. Enjoy your day – Clyde Jun 06 '13 at 18:45
0

You can just write a query in SQL Developer:

select /*csv*/ * from tableName

Then copy/paste the results to a new file.

This question How to export query result to csv in Oracle SQL Developer? also has several other suggestions.

Community
  • 1
  • 1
Tom Studee
  • 10,316
  • 4
  • 38
  • 42
  • Thanks for the response. I don't really understand the syntax. select C:\path\filename.csv * from tableName returned an error. I want SQL to write the file to the specified path on it's own. If I have to copy/paste that adds to the time I have to watch the program and when it finishes. I have 330M rows of data that I am trying to export, so the more automated the process is, the better. – Clyde Jun 06 '13 at 17:54
  • That option doesn't quite help me. It's fundamentally the same as using the export function from the query, just that the data is formatted. I still have to export manually. Thanks anyway! – Clyde Jun 06 '13 at 18:46