Re: Real Newbie Question
Posted in 1998
aaa@bbb.ccc wrote:
>
> Hi,
>
> I'm hoping someone can help me. I recently received a run time version of
> Informix as part of a package from Bay Networks called Optivity Call Reporter.
> Unfortunately this means that there is virtually no documentation as to how
> Informix actually runs.
> My problem is that I want to run sql queries from within my Unix environment
> (I run Solaris 2.5.1) without having to open dbaccess to query the database.
> Is it possible to set up shell scripts to do this, or run these queries from
> the Unix command prompt.
>
> I said it was a REAL newbie question didn't I ?? :-)
>
> Any help would be greatly appreciated.
>
> Tony Francis
DB Access will read SQL from its standard input like this:
dbaccess mydatabase <myfile.sql
The output is on stdout and various messages emerge on stderr.
You can incorporate this into shell scripts with pipes and the like.
Bear in mind that if you want to run a series of SQL commands and you
use a separate invocation of dbaccess each time you will have the
overhead of making the database connection each time.
If you don't have the printed dbaccess manual, you might like to
download the PDF file from the Informix web site. It is all explained
clearly in there.
--
Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
---
If all else fails, read the instructions AND the release notes.
All opinions are my own and not those of Bayer plc.
My Internet plumbing does not allow me to mail and post news together.
Sorry.
---
Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/