# Toad for DB2 4.7.2 disable auto formatter

**URL:** <https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995>\
**Category:** Toad for IBM DB2\
**Created:** [August 24, 2011, 4:56am UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995 "2011-08-24T04:56:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rc\_140](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rc\_140](https://forums.toadworld.com/u/rc_140)\
**Post date:** [August 24, 2011, 4:56am UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/1 "2011-08-24T04:56:21Z")

</div>

Hi,

We (our dev team) have just moved from IBM Data Studio to Toad for DB2 and we are very pleased with the Toad for DB2 (comercial licence) except one very very very annoying thing: the SQL auto formater.

**How can I disable it**?  
I’ve tried various options but none seems to disable it. It is messing our source code for views / stored procedures. I’ve tried to build some custom configuration for the auto formater but could not reproduce 100% the format that we use (some is contextual).

After losing way to much time with it I want it disabled as we should start using it on our development efforts.

Thank you.

---

<div class="post-metadata">

**Author:** ![Jeff\_Podlasek](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/jeff_podlasek/32/29_2.png) [@Jeff\_Podlasek](https://forums.toadworld.com/u/Jeff_Podlasek)\
**Post date:** [August 24, 2011, 12:29pm UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/2 "2011-08-24T12:29:19Z")

</div>

Without knowing the exact ways your source is being displayed\modified, I am not sure the formater is the culprit. Perhaps you can try this: navitate to Tools | Options | Editor | General and specify a zero for the 'Use Large Script Mode for files larger than...' value. The attached image shows how to do that and includes a snippet of the help topic for that control so you can see what editor features will be disabled.  
Hope this helps,  
Jeff  
 ![script.png](https://global.discourse-cdn.com/quest/original/2X/5/5f7548c9d5df72966f18dc7eb947feeaa2ad7c4d.png)

---

<div class="post-metadata">

**Author:** ![rc\_140](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rc\_140](https://forums.toadworld.com/u/rc_140)\
**Post date:** [August 25, 2011, 5:01am UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/3 "2011-08-25T05:01:46Z")

</div>

Thank you for your answer,

To clarify more I have attached some screenshots.

I’ve tested your suggestion but the behaviour of the formatting was the same (except now I was not having syntax highlighting and other goodies anymore).

I’ve made the following test (see attached screenshots, 1/step):

1. create a view with the format I want and run the create view ddl.
2. on this view, in Toad, view | Alter --\> the source of the view is messed up.
3. view | Send to Editor as Script --\> mesed up source
4. Viewer Views | Script --\> messed up source
5. Recreate view in IBM Data Studio
6. Check the view source in Data Studio (Alter) (OK!)
7. Check the view in Toad | Alter (OK!)
8. Check view in Toad | Send to Editor (OK!)
9. Re-run script in Toad (no screenshot)
10. The script is messed up (check point 2,3,4)

So it seems that in the moment Toad send the SQL Script to the database serve is messing up the formatting. This is not a DB setting (I think) as the Data Studio is not doing it like this.

I really appreciate some suggestions,  
Thanks  
[ToD2.docx](https://global.discourse-cdn.com/quest/original/2X/7/797b5bfdc61e3b85613c06ebd6ffc66904e47c69.docx) (174 KB)

---

<div class="post-metadata">

**Author:** ![Jeff\_Podlasek](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/jeff_podlasek/32/29_2.png) [@Jeff\_Podlasek](https://forums.toadworld.com/u/Jeff_Podlasek)\
**Post date:** [August 26, 2011, 4:56pm UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/4 "2011-08-26T16:56:39Z")

</div>

Thanks for the detailed information. Let us investigate this a bit now.

---

<div class="post-metadata">

**Author:** ![Jeff\_Podlasek](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/jeff_podlasek/32/29_2.png) [@Jeff\_Podlasek](https://forums.toadworld.com/u/Jeff_Podlasek)\
**Post date:** [August 30, 2011, 12:28pm UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/5 "2011-08-30T12:28:55Z")

</div>

When Toad reads database object definitions from the catalog it displays SQL based object definitions (i.e. views) as their definitions are stored in the catalog. When Toad executes CREATE statements, it trims out spaces (and any indentation within SQL based objects - i.e. views) to eliminate whitespace so DB2 statements do not exceed the DB2 maximum length (~2M). That trimming has been a requirement since the beginning of Toad DB2 as we have many customers with large Queries\Views\Etc that need to be able to execute SQL and create SQL objects that would have otherwise exceeded the ~2M limit without with whitespace trimming. I believe what you are seeing is that data studio does not trim out whitespace when creating SQL based objects. As you have shown, Toad will show those values formatted, (because the definitions for those objects are stored in the DB2 catalog as formatted). When a view is then altered or recreated in Toad, the whitespace is trimmed and those trimmed lines are stored in the catalog.  
In Toad, you can use the Format SQL button on the SQL Editor toolbar (or in the View Object Editor) to display the SQL in a formatted manner. (In the SQL Editor in Toad you can customizer how the SQL is formatted by using the drop down button on the Format SQL button, or by changing format options at Tools | Options | Editor | Formatter.)  
Hope this helps,  
Jeff

---

<div class="post-metadata">

**Author:** ![vlas.titov](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vlas.titov/32/130_2.png) [@vlas.titov](https://forums.toadworld.com/u/vlas.titov)\
**Post date:** [September 1, 2011, 6:27am UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/6 "2011-09-01T06:27:20Z")

</div>

It seems an IBM issue.  
IBM .Net provider removes end of line symbols (\r\n) internally.  
As result text in the system catalog stored in 1 line.

---

<div class="post-metadata">

**Author:** ![rc\_140](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rc\_140](https://forums.toadworld.com/u/rc_140)\
**Post date:** [September 1, 2011, 12:12pm UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/7 "2011-09-01T12:12:39Z")

</div>

Hi guys,

Thanks for the answers. Is there a solution for this? As this can be a deal killer for us (even if we bought 5 licences already) and we must then return in using the Data Studio.

As I recommended this product (based on Toad Modeler which we use for data modelling) will be quite embarrassing for me.

I think Microsoft has also an DB2 .Net provider but iirc is delivered just with SQL EE.

I would really need a quick solution for this as we are already started the project implementation and all our views/SPs are pretty much messe up atm.

---

<div class="post-metadata">

**Author:** ![vlas.titov](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vlas.titov/32/130_2.png) [@vlas.titov](https://forums.toadworld.com/u/vlas.titov)\
**Post date:** [September 2, 2011, 7:57am UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/8 "2011-09-02T07:57:03Z")

</div>

I created PMR 81641,756,000 with IBM and have sent them a simple test application how to reproduce it.  
Also looking here I can say that this is well known for IBM issue  
[http://bytes.com/topic/db2/answers/185392-bug](http://bytes.com/topic/db2/answers/185392-bug)  
P.S.  
Now I’m waiting an answer from IBM about it.

---

<div class="post-metadata">

**Author:** ![vlas.titov](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vlas.titov/32/130_2.png) [@vlas.titov](https://forums.toadworld.com/u/vlas.titov)\
**Post date:** [September 14, 2011, 2:47am UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/9 "2011-09-14T02:47:01Z")

</div>

Answer from IBM:

The APAR to address this issue is **IC78613**. You won’t be able to find it on [ibm.com](http://ibm.com) at this exact moment though as it is just going through some internal review of the text. You should be able to find it if you search on [ibm.com](http://ibm.com) in the near future though. If you want to know when the APAR is fixed, please search for the APAR on [ibm.com](http://ibm.com) and look for when it moves from OPEN to CLOSED state.

---

<div class="post-metadata">

**Author:** ![rc\_140](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@rc\_140](https://forums.toadworld.com/u/rc_140)\
**Post date:** [September 16, 2011, 4:30am UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/10 "2011-09-16T04:30:04Z")

</div>

Thank you guys, I really appreciate your support.

What is really very strange for me is, presuming I’m not the only customer for Toad for DB2 and this is the IBM .Net OleDB provider problem, how the other guys using Toad for DB2 can use it anyways? This problem should affect everyone.

Have nobody seen until now that all the views/stored procedures code formatting is messed up ? Until then I think my team will need to switch back to Data Studio. ☹

I really hope you/IBM find a quick solution for this.

Message was edited by: rc\_140

---

<div class="post-metadata">

**Author:** ![vlas.titov](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/vlas.titov/32/130_2.png) [@vlas.titov](https://forums.toadworld.com/u/vlas.titov)\
**Post date:** [September 16, 2011, 9:16am UTC](https://forums.toadworld.com/t/toad-for-db2-4-7-2-disable-auto-formatter/7995/11 "2011-09-16T09:16:10Z")

</div>

IBM has promised to fix it in the Fix Pack 6  
There is no such problem with procedures,- only with views
