Skip to content
Home » Oracle » How SQL Developer Export to CSV

How SQL Developer Export to CSV

Export to CSV

The export function for query result is not so obvious for developers to find out. In this post, I will show how to export query result as a CSV file.

Show Query Result as Grid

To show the query result in a grid table, you have to use F9 or Ctrl+Enter to format query result in grid.

SQL Developer Query Result
SQL Developer Query Result

Right Click Mouse and Export

Move your cursor over anywhere on the grid and right click the mouse, you will see Export option.

SQL Developer Query Result - Export
SQL Developer Query Result - Export

Export Entire Table

If the data you want to export is a table, not a query result, you can directly right-click on the table and select Export in the menu.

SQL Developer - Table Menu - Export
SQL Developer - Table Menu - Export

Select Export Format

SQL Developer showed Export Wizard window for interaction. Although there're many export types for us to select, we chose CSV format in this case.

SQL Developer Query Result - Export Format
SQL Developer Query Result - Export Format

Select Line Terminator

This option depends on your requirements. If you're going to use SQL loader in Linux/UNIX, you can select Unix/Mac LF, otherwise Windows CR LF is preferred. By the way, I kept header in this CSV file.

SQL Developer Query Result - Export Line Terminator
SQL Developer Query Result - Export Line Terminator

Select Text Encoding

I chose UTF-8 in order to match the database encoding.

SQL Developer Query Result - Export Encoding
SQL Developer Query Result - Export Encoding

Customize Filename

If you want to change the path, you can click Browse to navigate and choose a right directory to place.

SQL Developer Query Result - Export File Name
SQL Developer Query Result - Export File Name

Review Export Job Before Executing

You can expand all options to see the content of the export job.

SQL Developer Query Result - Export Summary
SQL Developer Query Result - Export Summary

Check Content of CSV File

CSV files are also plain text files, so they can be viewed in any text editor below.

SQL Developer Query Result - Export CSV File Content
SQL Developer Query Result - Export CSV File Content

In a similar way, we can export query result to an Excel file in SQL Developer.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *