Monday, December 21, 2009

Sqlplus : output newline

If you want to output your result to have a new line , you could add chr(10).

** without new line **
sql> select 'Hello!!!!!, My name is TaTsHuYa' from dual;

'HELLO!!!!!,MYNAMEISTATSHUYA'
-------------------------------
Hello!!!!!, My name is TaTsHuYa


** with new line **
sql> select 'Hello!!!!!,' || chr(10) || 'My name is TaTsHuYa' from dual;

'HELLO!!!!!,'||CHR(10)||'MYNAME
-------------------------------
Hello!!!!!,
My name is TaTsHuYa


== TaTsHuYa ==

No comments: