RE: help w/shell program
Posted in 1997
I just do the following
echo sql statement | dbaccess database_name
really pretty easy.
Returning this information into a variable is slightly harder.
but in ksh you can do
my_var=`echo sql statement | dbaccess database_name`
notice the ` is not a ' (use the character on the ~ key)
this will return a variable which contains the output in the worst possible format. You're on your own after that
-----Original Message-----
From: informix-list-owner@rmy.emory.edu [SMTP:informix-list-owner@rmy.emory.edu] On Behalf Of Teresa Crowl
Sent: Thursday, April 24, 1997 5:48 PM
To: informix-list@rmy.emory.edu
Subject: help w/shell program
Does anyone know how I would write a shell program to
take sql statements from a file and execute them
via dbaccess?
ie:
file name: adt_transactions
data is:
insert into patient_census VALUES("04/04/1997","A04","BC","3045","A")
insert into patient_census VALUES("04/04/1997","A04","WC","4045","A")
insert into patient_census VALUES("04/04/1997","A04","BC","3047","B")
.
.
.
??
TIA
Teresa Crowl
tjc@umbra.pvh.org