In UNIX, in a SQL script, i have following code:
LOOP
DBMS_OUTPUT.put_line (p_key||'|'||p_loc||'\n');
END LOOP
Output is:
5482004|Dir/3-30-2017/file:47923.xml
5482009|Dir/3-30-2017/file:49288.xml
However in Linux, since "\n" doesn't work, i am replacing the above code with following code:
LOOP
DBMS_OUTPUT.put_line (p_key||'|'||p_loc);
DBMS_OUTPUT.new_line;
END LOOP
Output is:
20 5482004|Dir/3-30-2017/file:447923.xml 5482009|Dir/3-30-2017/file:449288.xml 5482010|Dir/3-30-2017/file:449739.xml 5482012|Dir/3-30-2017/file:45015.xml
The output in this format is without the new line after each line. Please suggest what is in correct in the loop.
P.S. I have also tried DBMS_OUTPUT.put_line (p_key||'|'||p_loc||chr(10)) but the output is still without the new line.