Montag, 14. April 2008

Source beautifier for SQL statements

A lot of developers uses source code beautifier tools for their source code, e.g. our ObjectPascal. But I found a nice online-tool for SQL-statements. You can not only format the SQL-command for the Database-server (Oracle, MSSQL and other) like the following result:
SELECT HHJ,
CUSTOMER,
ORDER_ID
FROM TABLE

On the right side you have some options for formatting.

You can format this SQL-Statement for Delphi .....

var1 := 'SELECT HHJ,' ;
var1 := var1 + ' CUSTOMER,' ;
var1 := var1 + ' ORDER_ID' ;
var1 := var1 + ' FROM TABLE' ;

And other languages... e.g. for C# you can choose between
String var1 = "SELECT HHJ," ;
var1 = var1 + " CUSTOMER," ;
var1 = var1 + " ORDER_ID" ;
var1 = var1 + " FROM TABLE" ;
and
StringBuilder var1 = new StringBuilder("SELECT HHJ,");
var1.Append(" CUSTOMER,");
var1.Append(" ORDER_ID");
var1.Append(" FROM TABLE");


I found this very usefull for formatting my SQL-statement to read it sometimes later better..

Here you'll find the Online SQL and PL/SQL Formatter

12 Kommentare:

Anonym hat gesagt…

Very nice! I've being looking for something like this for a long time. Thank you.

Anonym hat gesagt…

Here is the latest version for this free online sql formatter:
http://www.wangz.net/gsqlparser/sqlpp/sqlformat.htm

thomas pfister hat gesagt…

thanks for the update-url! :-) thomas

Anonym hat gesagt…

HI,
here is another free online SQL Formatter. http://www.sqlinform.com

Regards
GuidoMarcel

Alper hat gesagt…

Thx. I've being looking for something like this for a long time.
God place you.
My Blog ;)

Alper hat gesagt…

Thx. I've being looking for something like this for a long time.
God place you.
My Blog ;)

Alper hat gesagt…

Thx. I've being looking for something like this for a long time.
God place you.
My Blog ;)

Anonym hat gesagt…

Thanks for sharing this link, but unfortunately it seems to be offline... Does anybody have a mirror or another source? Please reply to my post if you do!

I would appreciate if a staff member here at rave-notes.blogspot.com could post it.

Thanks,
Alex

thomas pfister hat gesagt…

Hi,

http://www.dpriver.com/pp/sqlformat.htm
is another (working / available ...) formatter for SQL.

:-) htomas

Anonym hat gesagt…

Hello there,

Thanks for sharing this link - but unfortunately it seems to be down? Does anybody here at rave-notes.blogspot.com have a mirror or another source?


Thanks,
Thomas

Anonym hat gesagt…

Hi,

Thanks for sharing this link - but unfortunately it seems to be down? Does anybody here at rave-notes.blogspot.com have a mirror or another source?


Cheers,
William

Anonym hat gesagt…

Hello there,

I have a message for the webmaster/admin here at rave-notes.blogspot.com.

Can I use part of the information from your blog post above if I provide a backlink back to your site?

Thanks,
John