Oracle Spool: Format Line Breaks in Export
When using the spool command in Oracle to export data, by default, the data will not be printed with new lines and will instead be continuously output in the same line. To have each row of data displayed on a new line, you can add the set markup command after the spool command and set the delimiter parameter to ”. The specific steps are as follows:
- Export data to a file using the spool command, for example:
spool data.txt
select * from table_name;
spool off;
- I will just go ahead and do it by myself.
spool data.txt
set markup html on delimiter '<br>'
select * from table_name;
spool off;
The data exported in this way will be output in HTML format with each line of data displayed on a new line.