# DBMS Output is stripping white spaces

**URL:** <https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772>\
**Category:** Toad for Oracle - Beta\
**Created:** [July 16, 2015, 5:22am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772 "2015-07-16T05:22:50Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoDabble](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@NoDabble](https://forums.toadworld.com/u/NoDabble)\
**Post date:** [July 16, 2015, 5:22am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/1 "2015-07-16T05:22:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![NoDabble](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@NoDabble](https://forums.toadworld.com/u/NoDabble)\
**Post date:** [July 21, 2015, 11:40pm UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/2 "2015-07-21T23:40:20Z")

</div>

Still not working in 12.8.0.11.

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [July 22, 2015, 6:49am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/3 "2015-07-22T06:49:09Z")

</div>

Fixed for next beta.

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [July 22, 2015, 6:51am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/4 "2015-07-22T06:51:54Z")

</div>

Actually, it’s not “fixed” for next beta. The behavior in Toad emulates SQL\*Plus. Blank lines there are not shown either.

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [July 22, 2015, 6:56am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/5 "2015-07-22T06:56:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![NoDabble](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@NoDabble](https://forums.toadworld.com/u/NoDabble)\
**Post date:** [July 22, 2015, 7:33am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/6 "2015-07-22T07:33:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![damir.vadas\_250](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/damir.vadas_250/32/37_2.png) [@damir.vadas\_250](https://forums.toadworld.com/u/damir.vadas_250)\
**Post date:** [July 23, 2015, 4:55am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/7 "2015-07-23T04:55:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![urban.tamas](https://avatars.discourse-cdn.com/v4/letter/u/46a35a/32.png) [@urban.tamas](https://forums.toadworld.com/u/urban.tamas)\
**Post date:** [July 23, 2015, 6:17am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/8 "2015-07-23T06:17:40Z")

</div>

Use

SET SERVEROUT ON FORMAT WRAPPED

and your leading whitespaces preserve in the output.

You can see in documentation: [docs.oracle.com/…/ch12040.htm](http://docs.oracle.com/cd/B28359_01/server.111/b31189/ch12040.htm#i2699298)

The default is WORD\_WRAPPED which removes leading whitespaces.

Maybe TOAD should use WRAPPED by default at startup?

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [July 23, 2015, 6:24am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/9 "2015-07-23T06:24:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![NoDabble](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@NoDabble](https://forums.toadworld.com/u/NoDabble)\
**Post date:** [August 3, 2015, 2:53am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/10 "2015-08-03T02:53:33Z")

</div>

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???

---

<div class="post-metadata">

**Author:** ![NoDabble](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@NoDabble](https://forums.toadworld.com/u/NoDabble)\
**Post date:** [September 7, 2015, 9:48am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/11 "2015-09-07T09:48:42Z")

</div>

Issue still present in 12.8.0.22

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [September 7, 2015, 10:38am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/12 "2015-09-07T10:38:09Z")

</div>

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](mailto:bounce-NoDabble@toadworld.com)]

**Sent:** Monday, September 07, 2015 12:50 PM

**To:** [toadoraclebeta@toadworld.com](mailto:toadoraclebeta@toadworld.com)

**Subject:** RE: [Toad for Oracle - Beta Discussion Forum] DBMS Output is stripping white spaces

**[RE: DBMS Output is stripping white spaces](http://www.toadworld.com/products/toad-for-oracle/toad_for_oracle_beta_program/f/86/p/25049/56008#56008)**

Reply by NoDabble

Issue still present in 12.8.0.22

To reply, please reply-all to this email.

[Stop receiving emails](http://www.toadworld.com/products/toad-for-oracle/toad_for_oracle_beta_program/f/86/t/25049?subscribe=false) on this subject.

Or [  
Unsubscribe from Toad for Oracle - Beta](http://www.toadworld.com/products/toad-for-oracle/toad_for_oracle_beta_program/f/86?subscribe=false) notifications altogether.

Toad for Oracle - Beta Discussion Forum

[Flag](http://www.toadworld.com/products/toad-for-oracle/toad_for_oracle_beta_program/f/86/p/25049/56008?AbuseContentId=55c13162-3d5f-4aa4-9bdd-11a2b830fa3d&AbuseContentTypeId=f586769b-0822-468a-b7f3-a94d480ed9b0&AbuseFlag=true)  
this post as spam/abuse.

---

<div class="post-metadata">

**Author:** ![NoDabble](https://avatars.discourse-cdn.com/v4/letter/n/9fc29f/32.png) [@NoDabble](https://forums.toadworld.com/u/NoDabble)\
**Post date:** [September 10, 2015, 2:19am UTC](https://forums.toadworld.com/t/dbms-output-is-stripping-white-spaces/33772/13 "2015-09-10T02:19:45Z")

</div>

Fixed in 12.8.0.25! Thanks!!
