BusyAnt BusyAnt - 1 year ago 66
SQL Question

Replacing `(null)` with blank cell in SQL query result

I believe what I'm asking here is possible, but I haven't find a way yet :

Some cells in the result of my SQL SELECT-FROM-WHERE query are blank, and in DbVisualizer,

is written inside. I'd like to display a blank cell instead.

I've already tried with CASE-WHEN and the NVL operator, but it won't let me replace it by a blank
, I'm forced to use some
' '

I know I could just delete these spaces or messages with Excel later, but I'd like to know if there is a way to do it directly with DbVisualizer, instead of this workaround.

EDIT: Here is what my request looks like :

SELECT *things*,
(SELECT COUNT(*) FROM table d2 WHERE *join-condition* AND *other condition*) = 1
(*sub-select query*)
*other things*
FROM table d1
WHERE *something*

Thanks a lot !

Answer Source

The problem in your query is the following ELSE part of the CASE expression:


In Oracle, an empty string is considered as NULL value. So, all you need to do is use something else instead of ''.

For example, to use a space instead of NULL:

   ' '

Update The issue is the DbVisualizer tool. OP is on version 8.0.12. Prior to version 9.2.8 it cannot show NULL as an empty string. However, as discussed in this forum, it has been fixed in DbVisualizer 9.2.8.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download