Toad World® Forums

Formatting SQL Script


#1

Is the formatter supposed to work in 6.0? I select

keywords Right Aligned
Stacked
stacked

for a select statement, but it wraps them every time.

Same thing for insert.

thanks,
Jet


#2

OK, I think I got it to work. First I had to save the formatting options file into the sql nav directory, then I had to reopen it.

Weird, but maybe that fixed it.


#3

Its definitely a bug. Bruce is looking into it. we will keep you posted.


#4

Just curious, has this been looked at any more?

Jet


#5

Hi Jet,

Unfortunetly, 6.0 will not include any changes for the Formatter. We will include the fix for this issue in 6.1 and make sure Formatter works with Oracle 11G. We will have a 6.1 beta build for you soon after 6.0 goes out.

Gwen


#6

Hi Gwen,

Do I understand correctly, that if no changes for Formatter then there is no hope that in 6.0 PL/SQL code with conditional compiling can be formatted?

Marko

BTW. Actually I would be fully satisfied if Formatter would ignore everything from last “;” before $IF to the first “;” after “$END”. Yes, then many “conditional” tricks will be not supported and code block must be monitored (begin-end, if end if; etc). But at least it would work! (I realize that full support of conditional compiling is quite a rocket science)


#7

Hi Marko,

We’re getting really close to the end of the cycle now so it’s extremely risky to make changes to the Formatter. Although we have made some changes to the component itself, we decided to wait till 6.1 to incorporate those changes into Nav. Nav 6.1 beta will be available shortly after 6.0 release.

Regards
Gwen


#8

Any progress on this? It would just be nice if the darn thing would recognize your settings.

I can’t even get it do this in the current version.

Jet


#9

Hi Jet, I’m Vincent and I am the one who’s working on formatter in Nav6.1. I promise that you can have a formatter working good on what you wanted with Nav6.1:). The options will work fine and can be saved and loaded correctly. The GA is coming soon.

Thanks,
Vincent


#10

Hi Joe,

A lot of works have been down for the new formatter so it will be much better than the one in 6.0. You’re using the 6.1 beta (b1071) right? If so, you should be able to make changes to options and apply these when formatting. Would you mind providing us a use case where the formatter is not working for you?

Thanks
Gwen


#11

No changes I make to my preferences get used. It must be using some other file and I have no idea where it is stored because i did a search. Is there some registry setting i can look at.

For example, I disable comments and advice yet they continue to show up. It’s like it’s using the default formatting even though, when I bring up the program with the preferences they look like what I want.

Very annoying to point of frustration. Essentially I can’t use the formatter right now because it formats things all wrong.

Jet


#12

After you formatted the code, what version of formatter does it show on the header line?
Gwen

Message was edited by: Gwen


#13

/* Formatted on 11/6/2008 1:36:04 PM (QP5 v5.116.810.22051) */


#14

Hi Joe,

Thanks for your quick reply. When you go into Format Options, on the header of that window it shows the path of the file FmtOptions.opt which all the options get stored in.
In the early post, you said you tried to disable the inline comment. Did you do it from the Tools>Formatter Tools> Enable inline advice or by changing an option from the Formatter Options window?

Please also provide more information about the formatter not format something correctly.

Thanks
Gwen


#15

Yes, I see the file directory and the file is being updated. It isn’t being used.

I disabled it in both places. I think I got it to stop dispensing advice, but the format header is still showing up. NO changes I make to the format (e.g. putting THEN on the same line as the IF) seem to work.

Are you saying you can make changes and see them happen? It really isn’t very hard to duplicate for me.

Jet


#16

Hi Joe,

I checked again and realized that the version of QP5 that you’re using have a fair bit of options not working. They made some changes to optimize the formatter but as a result broke a number of options. Some options still work (for example the options to change cases). This issue has been addressed in our current internal build.

Also about the issue with header still showing, there are 1 option to disable the header and 1 to disable the inline advice. Please check this again when you get a new build.

I apologize for your inconvenience.
Gwen


#17

Hi

There should by said out loud that formating configuration is saved in new place, not as it used to be. Instead of SQL Navigator root
…:\Program Files\Quest Software…
6.1 beta uses
…:\Documents and Settings[user]\Application Data\Quest Software…

So when one wants to use old conf-file will not see any “change” with first attempt.

Marko


#18

Ok, I seem to be using the one in the documents and settings area.

Some of the options seem to be working (I need to test some more), but the one that isn’t working for sure is the “General | Header | Disable” the header is continuing to be put into the code.


#19

Hi Marko,

We will make sure this change is documented in the help file as well as the release note. Thanks.

Gwen


#20

Hi Joe,

If you don’t intend to migrate the settings from previous version, this change shouldn’t affect you at all. The issue with options not working is the result of a different change and it has been fixed. We’re planning to put out another beta by the end of this week. Please check it and let us know if they’re working ok.

Thanks a lot.
Gwen