How To Export Table To CSV Using Oracle SQL Developer?

How To Export Table To CSV Using Oracle SQL Developer?

In this tutorial, you will learn how to export Table data to CSV file using Oracle SQL Developer. For the following example, I am using an SQL query to retrieve the data and then export the results to a CSV. So in this case, you can export not only single table data, but you can join multiple tables to export different columns from different tables.

Follow These Steps to Export Table Data to a CSV File Using Oracle SQL Developer

  1. Open Oracle SQL Developer and connect to the database.
  2. Then click on the menu File > New and the New Gallery window will open. Then choose Database Tier > Database Files > SQL File and click OK to open an SQL editor.
  3. Then type your SQL query and press Ctrl+Enter to get the result in a grid in Oracle SQL Developer. The following is an example query:
SELECT
     e.employee_id,
     e.first_name,
     e.last_name,
     e.department_id,
     d.department_name
 FROM
     employees e,
     departments d
 WHERE
     e.department_id = 90
     AND e.department_id = d.department_id;
  1. Now do the right-click on the query results grid and from the shortcut menu select Export option.
  2. Then an Export Wizard window will open, as shown in below image.

Export table data using SQL query to CSV file in Oracle SQL Developer

  1. Then choose CSV option from the Format drop-down if you want to keep delimiter Comma for the CSV file, else if you're going to export data other than Comma delimiter, then choose Delimited Option from the drop-down and specify the field separator from the Delimiter drop-down. Click the check-box Header if you want to export the column headers. Specify the file location and name in File field then click on the Next button.
  2. On the next step, it will show you the export summary. Then click on the Finish button to export the data.

Now you can check your file location for the generated CSV file Using Oracle SQL Developer.

See also: