Monday, August 30, 2010

SQL Developer: Turn Off "Autogenerate GROUP BY"

This is more for me since I seem to install it quite regularly.

I've been snagging the SQL from OBIEE query logs (nqquery.log), which doesn't come out too pretty.

So that I don't have to manually format 400 lines of SQL, I created a formatting template. Ctl - F7 and voila!

I do go back in and make small changes, which is why I am writing this. As I scroll down through the file and indent or change code, the GROUP BY clause is auto-generated, which is annoying to me.

To turn it off is easy (if you can remember, which I can't, which is why I write this).

Go to Tools - Preferences then look for Code Editor:

Code Editor

Expand that group and then go to Completion Insight:

completion insight

Uncheck the box next to the arrow and you're done.

My hope is that in the next version of SQL Developer, we'll be able to call the SQL Beautifuler from the command line. That would be pure awesome.

3 comments:

Daniel Latikaynen said...

excellent. it had been driving me mad. thank you for sharing this!

Christian said...

Chet,

Did they add the SQL Beautifier option in the latest versions of SQL Developer?

Cheers,
Christian

oraclenerd said...

@christian,

You can still use the Shift + F7 trick to format your code. You can modify that format by going to Tools > Preferences > Database > SQL Formatter