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..."

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.

2
  • Learn something new every day :) +1
    – Philᵀᴹ
    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

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.