I'm running a SELECT statement on the form below:
SELECT col1 ||'|'|| col2 ||'|'|| col3
FROM table;
This gives me the following outprint, which is what I need
col1|col2|col3
varchar2|number|varchar2
The problem is when col2 is returning a NULL value, then I get this:
varchar2||varchar2
When what i want is this:
varchar2|(null)|varchar2
Is there any way to get my query results to print NULL value as (null)?
I've tried the NVL function, NVL(col2, 'null') but this won't work since there's a mismatch on datatypes. I can get the NULL value printed by not concatenating the columns and save the results as csv, but that does not give me the formatting I want.