RE: Export data in order to use it as a variable in shell
Posted in 2000
Ilhan
Maybe this will help?
$INFORMIXDIR/bin/dbaccess account 2>/dev/null 1>&2 <<!
unload to report.txt
SELECT sales_code
FROM account!
cat report.txt | while read sales_code
do
mailx -s "Report" $sales_code@host < report_file
done
HTH
Sujit
"Martin, Wayne E." <WMartin@kmart.com> on 11/22/2000 06:16:48 AM
To: "'ilerden@ea-dc.dhl.com'" <ilerden@ea-dc.dhl.com>, Informix
<informix-list@iiug.org>
cc:
Subject: RE: Export data in order to use it as a variable in shell
Looks OK, is there a problem?
Wayne E. Martin
Informix Database Administrator
Kmart Corp.
-----Original Message-----
From: Ilhan Erden [mailto:ilerden@ea-dc.dhl.com]
Sent: Wednesday, November 22, 2000 4:32 AM
To: Informix
Subject: Export data in order to use it as a variable in shell
Hi Gurus
I have a new challenge.
There is a sales_code data field in the database which includes
data which again I want to use as a variable in the e-mail address.
The script should be something like :
---------------------------------------------------------
$INFORMIXDIR/bin/dbaccess account 2>/dev/null 1>&2 <<!
unload to report.txt
SELECT sales_code
FROM account!
mailx -s "Report" sales_code@host < report.txt
---------------------------------------------------------
Thanks in advance...
Ilhan Erden