<p>I currently work with an Oracle database and we use stored procedures for all our SQL queries. The problem I have is that we do not really having a coding standard for our packages. So what happens is that every developer has a different style (or in some cases no sense of style) in how they format there packages. Making them difficult to read and work on with out first reformatting. We all pretty much just use Notepad or Notepad2 to write our packages. </p>

<p>I am unfortunately not in a position to mandate a coding standard and enforce it (just a code monkey at this point) so I was hoping to find a free SQL code formatter that I can use myself, and possibly suggest to others on the team to use, to make my life easier.</p>

<p>I have considered writing a small application that would essentially take a file as input and reformat everything, but before I did this I figured I would ask if anyone new of such a tool that is already available and is free.</p>

<p>So does anyone now of any such tools available? </p>

[{'answer_id': 33922, 'author': 'jason saldo', 'author_id': 1293, 'author_profile': 'https://Stackoverflow.com/users/1293', 'pm_score': 2, 'selected': True, 'text': '<ul>\n<li><a href="http://www.vim.org/scripts/script.php?script_id=492" rel="nofollow noreferrer">VIM script</a> </li>\n<li><a href="http://www.aquafold.com/" rel="nofollow noreferrer">Aqua Data studio</a> $ I use this one all the time.</li>\n</ul>\n'}, {'answer_id': 33958, 'author': 'Josh Buedel', 'author_id': 947, 'author_profile': 'https://Stackoverflow.com/users/947', 'pm_score': 1, 'selected': False, 'text': '<p>I like <a href="http://www.toadsoft.com/toad_oracle.htm" rel="nofollow noreferrer">TOAD for Oracle</a>.  It has a format feature that\'s decent.  I see there\'s a freeware version, though I have not used it.</p>\n'}, {'answer_id': 34070, 'author': 'Mark Harrison', 'author_id': 116, 'author_profile': 'https://Stackoverflow.com/users/116', 'pm_score': 1, 'selected': False, 'text': '<p>Toad for Oracle</p>\n\n<ul>\n<li>nicest, most mature</li>\n<li>$$$</li>\n<li><a href="http://www.toadsoft.com" rel="nofollow noreferrer">http://www.toadsoft.com</a></li>\n</ul>\n\n<p>Toad for Oracle, free version</p>\n\n<ul>\n<li>free</li>\n<li>this will do what you want</li>\n<li>limitations are related to number of connections, size of data mods, etc.</li>\n<li><a href="http://www.toadsoft.com" rel="nofollow noreferrer">http://www.toadsoft.com</a></li>\n</ul>\n\n<p>Oracle SQL Developer (up and coming, free!)</p>\n\n<ul>\n<li>free</li>\n<li>from Oracle</li>\n<li>cross platform</li>\n<li><a href="http://www.oracle.com/technology/products/database/sql_developer" rel="nofollow noreferrer">http://www.oracle.com/technology/products/database/sql_developer</a></li>\n</ul>\n'}, {'answer_id': 34260, 'author': 'stjohnroe', 'author_id': 2985, 'author_profile': 'https://Stackoverflow.com/users/2985', 'pm_score': 2, 'selected': False, 'text': '<p>There is a free one online <a href="http://www.orafaq.com/utilities/sqlformatter.htm" rel="nofollow noreferrer">sqlformatter</a>, also <a href="http://www.sqlinform.com/" rel="nofollow noreferrer">SQLinForm</a>, personally i use TOAD and have done since before it was bought by Quest (10 years?)</p>\n'}, {'answer_id': 55520, 'author': 'blinderzoff', 'author_id': 5683, 'author_profile': 'https://Stackoverflow.com/users/5683', 'pm_score': 1, 'selected': False, 'text': '<p>I had the exact same experience from Day One working with Oracle stored procedures - "I have to use NOTEPAD?! Oh HELL no."</p>\n\n<p>So I hopped on the internets and what I found were people saying "Hey, I have to create stored procedures in Oracle, isn\'t there anything better than NOTEPAD?!"</p>\n\n<p>And the canonical answer was: "Download TOAD, you\'ll be glad you did". So I followed their advice, was very happy with it, and I\'m pleased (if a bit amazed) to see it is still a popular answer.</p>\n'}]
['https://Stackoverflow.com/questions/33903', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3340/']