in relation with how to copy the records from output of oracle SQL developer to excel sheet
I'm using Oracle SQL developer. I've some queries which get some null values in the result grid. I'd cut/paste these values in Excel but null are pasted as empty, not as "null", so difficult to find them among cells that contains spaces. Is there any way to export null as "null" in Excel please?
Thank you.
CodePudding user response:
If your column is of datatype varchar2 then:
select case
when your_column is null then 'null'
else your_column
end your_column
from your_table;
If your column is of number or date datatype then just convert the non null values to string using to_char:
select case
when your_column is null then 'null'
else to_char(your_column)
end your_column
from your_table;
CodePudding user response:
You have multiple options:
- Using case with the
IS NULL
comparison - Using NVL()
- Using
DECODE()
with something likeDECODE(<col>, NULL, 'NULL', <col>)