Re: passing variables to sql statements in a Unix shell script
Posted in 1998
In article <eVEbENM89GA.207@upnetnews02.moswest.msn.net>,
"Kirt" <kirt_t@email.msn.com> wrote:
> I am trying to pass a variable array in the from statement to select from a
> list of table in a loop. I have been unable to make it work. Is there a
> way and if so how?
In article <eVEbENM89GA.207@upnetnews02.moswest.msn.net>,
[SNIPPED]
Hello Kirt,
I give you following suggestion:
#!/bin/ksh
MATCHER="andy"
echo "Database seek in progress. Please be patient....\\c"
~informix/bin/dbaccess database -<<eof
unload to "/tmp/xxx.unl"
select * from any_table where name1 matches "${MATCHER}";
eof
echo "done. Look in /tmp/xxx.unl the result"
# End of skript
Yes, it works fine, but it is not really fast, because the
swapping of dbaccess is heavy for the processor. In this
case, we build skripts, that generate sql-code and then, we
run this code with one dbaccess-call (this is an other way).
Bye
Andy
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own