I am trying to export data from Oracle into CSV with the below commands:
SET ECHO OFF
SET NEWPAGE 0
SET SPACE 0
SET PAGESIZE 0
SET FEED OFF
SET HEAD OFF
SET null NULL
SPOOL STUDENT.CSV
SELECT ID ||’,’|| NAME ||’,’|| ADMISSION_DATE FROM STUDENT;
SPOOL OFF;
However, when using the concatenate operator(||','||) and set null NULL option together, it keeps the null value as a blank string (‘’) in CSV file instead of replacing it with NULL.
Can someone please tell how to use set null and concatenate operator together?