-
Hi,
How can I put an empty line in the pl/sql output to make reading easier? i.e. I'd like to separate the output so they won't all grouped together which is hard to read.
I tried to put
dbms_output.put_line(' ');
into my pl/sql code, but it is just get skipped.
Any idea? Thanks!
-
Use ASCII sequence for LF or CR+LF (ascii 10 and 13):
SQL> begin
2 dbms_output.put_line(sysdate);
3 dbms_output.put(CHR(10));
4 dbms_output.put_line(sysdate);
5 end;
6 /
28.09.01
28.09.01
PL/SQL procedure successfully completed.
If you are doing this in SQL*Plus then you can use the following setting:
SET SERVEROUTPUT ON FORMAT WRAPPED
SQL> set serveroutput on format wrapped
SQL> begin
2 dbms_output.put_line(sysdate);
3 dbms_output.put_line('');
4 dbms_output.put_line(sysdate);
5 end;
6 /
28.09.01
28.09.01
PL/SQL procedure successfully completed.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
Originally posted by jmodic
dbms_output.put(CHR(10));
CHR(10) does the same as dbms_output.new_line;
-
No, it does not. At least not in SQL*Plus with the default setting of SERVEROUTPUT FORMAT WORD_WRAPPED.
SQL> set serveroutput on
SQL> begin
2 dbms_output.put_line(sysdate);
3 dbms_output.new_line;
4 dbms_output.put_line(sysdate);
5 end;
6 /
29.09.01
29.09.01
PL/SQL procedure successfully completed.
SQL>
SQL> begin
2 dbms_output.put_line(sysdate);
3 dbms_output.put(CHR(10));
4 dbms_output.put_line(sysdate);
5 end;
6 /
29.09.01
29.09.01
PL/SQL procedure successfully completed.
See, in the first case there is no separate line between the two lines with the date. That is because with the sefault setting Oracle trims all leading spaces and also skips all "empty" lines. If you wan't to prevent this you must set SERVEROUTPUT FORMAT WRAPPED as I have indicated in my first reply.
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
:-) Well, set then SERVEROUTPUT FORMAT WRAPPED
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|