1

In SQL Developer 4.0 I have my Pref > Database > Advance > Display Null value as (null) **Pretty sure that was the default value

My Query Results Report Grid show NULLs as (null).... Perfect!

When I export (or copy / paste) to any formatted file type, tried them all, data that shows up as "(null)" in my Query Results Report Grid is now just a single space, " "...

I am trying to provide QA Testing reports to another department and although I could solve this writing SQL and formatting the output for every column, I would rather just export or copy /paste into excel to produce my proofs.

Is there a preference for this behavior I am not seeing?

Kurt

1 Answer 1

2

You can use the SQL*Plus set null command, which is one of many SQL Developer recognises.

When you set that and then run your query as a script (F5) the output appears in the Script Output window, and whatever text you specified appears instead of null. You can copy and paste from there but then you have to convert the text to data in Excel.

If you run your query as a statement (Ctrl-Enter) then the output in the Query Result window shows the value you set in the preferences, not what you specified with set null. However, when you right-click and export to CSV, the export file does use the set null string.

For example, if you set the null handling in your worksheet:

set null "NULL"

and then run a query as a script:

select 1 as id, null as value from dual;

the Script Output window shows:

        ID VALUE
---------- -----
         1 NULL 

If you run the query as a statement then the Query Result window shows the (null) from preferences rather then NULL:

enter image description here

But when you right-click and export as CSV, the file produced contains:

"ID","VALUE"
1,NULL

If you do set null "(null)" so that value matches the display preference then you won't notice the difference, of course.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.