Teresa Crowl wrote:
>
> 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
If all the SQL statements are in one file :
dbaccess DATABASE_NAME adt_transactions
Put this statement in your script file. You may have to put ";" at the
end of each of your SQL statements.
The only problem we've found with running dbaccess from shell scripts is
verifying that the SQL statements executed successfully.
HTH