Re: Stupid question
Posted in 1997
Topics: SQL Development & Query Writing, Connectivity: ODBC / JDBC / .NET, Server Administration, Platform-Specific Issues, Java & JDBC Development
Heres an example of a simple unix shell script that you can use
for any SQL statement. I'ved used a select statement.
isql DBNAME >/dev/null 2>&1 <<-eof
select * from TABNAMEeof
If you need to return a value to your shell script
then redirect the output like this
VARNAME=`isql DBNAME 2>/dev/nul <<-eof
select tabname from systables
where tabid = 2eof`
Hope this helps.
Richard Fremmerlid <lsbcoop2@hq.marh.gov.bc.ca> wrote in article
<6795b2$9fo@cssun.mathcs.emory.edu>...
> I just started using Informix about 3 months ago and have used it for
> a web application through LiveWire on HP-UX10.10. I have been using
> shell scripts with dbaccess etc to to create and load tables, but what
> I was never able to ascertain is how you would call other SQL functions
> like SELECT, DELETE, UPDATE etc from within scripts. I did all database
> processing with Server-Side Javascript through LiveWire. I have
experience
> with ODBC programming in NT/95 but would like to know how to do similar
c/c++
> database programming in UNIX. Could someone provide a simple example for
> me of use of SQL through scripts and c through unix. If I see a basic
example
> I can probably pick up the rest from there.
>
> I appreciate it.
>
>
>