Using the following code to illustrate my point:
begin
dbms_output.put_line (’ This sentence starts with three spaces.’);
dbms_output.put_line (’ ‘);
dbms_output.put_line (’ There should be a blank line before this sentence.’);
end;
/
In Toad 12.5.1.1 I get this (correct) output:
This sentence starts with three spaces.
There should be a blank line before this sentence.
In Toad 12.8.0.9 (beta) I get this:
This sentence starts with three spaces.
There should be a blank line before this sentence.
No leading spaces and no blank line in between. I can’t find any obvious settings to make it include the spaces. Is this a bug?
Still not working in 12.8.0.11.
Actually, it’s not “fixed” for next beta. The behavior in Toad emulates SQL*Plus. Blank lines there are not shown either.
If you want to use a dummy value to force a blank line then use a tab and not a space. dbms_output.put_line (Chr(9)); will cause line 2 to contain a tab and it is not trimmed.
Great! The leading spaces are important to me for certain forms of indented output. I’m happy to use chr(9) to force a blank line. chr(12) also does the trick.
This is never ending story with white space and sqlplus. here is example on 11.2.0.3 Win x64 client
13:51:49 SQL>set serveroutput on size unlimited;
13:51:56 SQL>begin
13:51:58 2 dbms_output.put_line (’ This sentence starts with three spaces.’);
13:51:58 3 dbms_output.put_line (’ ‘);
13:51:58 4 dbms_output.put_line (’ There should be a blank line before this sentence.’);
13:51:58 5 end;
13:51:58 6 /
This sentence starts with three spaces.
There should be a blank line before this sentence.
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.03
13:51:59 SQL>
So here was no Toad in game?
Use
SET SERVEROUT ON FORMAT WRAPPED
and your leading whitespaces preserve in the output.
You can see in documentation: docs.oracle.com/…/ch12040.htm
The default is WORD_WRAPPED which removes leading whitespaces.
Maybe TOAD should use WRAPPED by default at startup?
Good catch. Also, looks like the script engine has a bug here too. It’s always running as if “format wrapped” is enabled even when it’s not.
So is there a possibility that this could be included as an option in a future release, ie to have the DBMS Output tab behave as drbubo20 described above and thereby preserve leading whitespace???
Issue still present in 12.8.0.22
For next beta an option has been added to trim leading/trailing whitespace to Oracle|General options page. The default is checked. When checked the behavior is the same as it’s always been. When unchecked all leading whitespace is retained and lines containing only whitespace will show in output.
From: NoDabble [mailto:bounce-NoDabble@toadworld.com]
Sent: Monday, September 07, 2015 12:50 PM
To: toadoraclebeta@toadworld.com
Subject: RE: [Toad for Oracle - Beta Discussion Forum] DBMS Output is stripping white spaces
RE: DBMS Output is stripping white spaces
Reply by NoDabble
Issue still present in 12.8.0.22
To reply, please reply-all to this email.
Stop receiving emails on this subject.
Or
Unsubscribe from Toad for Oracle - Beta notifications altogether.
Toad for Oracle - Beta Discussion Forum
Flag
this post as spam/abuse.
Fixed in 12.8.0.25! Thanks!!