fsqlf を試す
fsqlf ( http://sourceforge.net/projects/fsqlf/ ) は、SQL をフォーマットするためのオープン ソースのコマンド ラインまたは GUI プログラムです。最終製品の外観を柔軟に調整できるformatting.confファイルをサポートしています。
例 1:
☺ [wwalker@speedy:~]
$ echo "select f1, f2, fname, lName from tblName where f1 = true and fname is not null order by lName asc" | fsqlf
SELECT
f1
, f2
, fname
, lName
FROM tblName
WHERE f1=true
AND fname is not null
ORDER BY lName asc
例 2:
☺ [wwalker@speedy:~]
$ vim formatting.conf # 2 character change
☺ [wwalker@speedy:~]
$ echo "select f1, f2, fname, lName from tblName where f1 = true and fname is not null order by lName asc" | fsqlf
SELECT
f1 ,
f2 ,
fname ,
lName
FROM tblName
WHERE f1=true
AND fname is not null
ORDER BY lName asc
例 3:
☺ [wwalker@speedy:~]
$ vim formatting.conf # 1 character change
☺ [wwalker@speedy:~]
$ echo "select f1, f2, fname, lName from tblName where f1 = true and fname is not null order by lName asc" | fsqlf
SELECT
f1 , f2 , fname , lName
FROM tblName
WHERE f1=true
AND fname is not null
ORDER BY lName asc