From: karistom@hotmail.com (Christine)
Newsgroups: comp.databases.oracle
Subject: Re: niceSQL / SQL Formatter
Date: 10 Nov 2003 23:50:33 -0800
Organization: http://groups.google.com
Lines: 41
Message-ID: <693b7163.0311102350.15ac0274@posting.google.com>
References: <2addeffc.0310270800.3fbc80e@posting.google.com> <3561692.1068030260@dbforums.com>
NNTP-Posting-Host: 220.209.80.87
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1068537033 11748 127.0.0.1 (11 Nov 2003 07:50:33 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 11 Nov 2003 07:50:33 +0000 (UTC)


ingehalv <member45830@dbforums.com> wrote in message news:<3561692.1068030260@dbforums.com>...
> The tool is approved by downloads.com and eSellerate.
> 
> Its a C# based Nice-To-Have tool that works.
> 
> 
> 
> See: http://download.com.com/3000-2210-10238125.html?tag=lst-0-1
> 
> 
> 
> See: http://home.broadpark.no/~ihalvor/

Here is useful SQL formatter (in bcsh).
I quickly wrote this coz I don't wanna install heavy prog on my system.
This is not so good, but not that bad.

----------------------------------------
INPUT_FILE="testsql.in"

  while read line; 
  do
    for word in $line
    do 
      u_word=`echo $word | tr [:lower:] [:upper:]`
      if [ $u_word = "SELECT" ] || \
         [ $u_word = "WHERE" ] || \
         [ $u_word = "FROM" ] || \
         [ $u_word = "ORDER" ] || \
         [ $u_word = "DECLARE" ] || \
         [ $u_word = "BEGIN" ] || \
         [ $u_word = "EXCEPTION" ]
      then
        echo $word
      else
        echo '       '$word 
      fi
 
    done
  done < $INPUT_FILE
--------------------------------------

