Re: SQL queries from shell scripts, and capitalisation
Posted in 1997
Art S. Kagel wrote:
>
> phil@oyster.co.uk wrote:
> >
> > I have 2 questions:
> >
> > (1) How do I run an SQL query from the Unix shell? In the
> > FAQ it talks about running isql, but this doesn't seem to
> > be on my system. Is isql part of OnLine or does it only
> > come with the other Informix database?
> dbaccess mydatabase - <myscript.sql
or even:
echo "select stuff from mytable" | dbaccess mydatabase -
> > (2) I have a table which includes a row of strings which
> > are in all upper case. I want to output the result in mixed
> > case with the 1st character of every word capitalised, and
> > the other characters in lower case. Is it possible to do
> > this in SQL?
Check out:
http://www.wollery.demon.co.uk
You'll find 3 different sed scripts to capitalize the first
character of every word. If you're doing SQL from the Unix shell
this may suit your needs.
Douglas Wilson