2

When exporting to CSV in Oracle SQL Developer, null values are replaced with "". I want them to be exported as the string null. Is this configurable anywhere?

Example of what is wished:

"STARTDATE", "ENDDATE"
"2017-03-16 00:00:00", null

instead of:

"STARTDATE", "ENDDATE"
"2017-03-16 00:00:00", ""

Exporting is performed by running a query, right-click on the data shown in the grid and select "Export..."

asked Mar 14, 2017 at 13:27

1 Answer 1

5

Just set the below in your session, as you would do in SQL*Plus:

set null "null"

Note: this will not affect how NULLs are displayed in the data grid (you can set that from the menu: Tools - Preferences - Database - Advanced - Display Null Value As), but it affects the exported CSV.

answered Mar 14, 2017 at 13:36
2
  • Learn something new every day :) +1 Commented Mar 14, 2017 at 13:38
  • 1
    For some odd reason, I was running a 1.5.x version of Oracle SQL Developer for which 'set null "null"' returned an 'SQLPLUS Command Skipped:' error. With the latest version (4.1.5), it works flawlessly. Thank you. Commented Mar 14, 2017 at 14:53

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.