Re: Getting data to a file, and divide by zero
Posted in 1995
Niel,
To run an sql script from the command line I would use a script with a
here document to do it as follows:
#! /bin/sh
#
# Script to run some sql command.
#
# Use a here document to create your sql statement. This is useful to
include some
# variables.
#
cat <<EOF > /tmp/sqlfile.sql
select name,phone from customer
where .....
EOF
#
#Then run your sql that you created.
#
isql -s <database> -qcr /tmp/sqlfile
#eof
Hope this helps
Bill Katelis
bkatelis@ventoas1.telecom.com.au
----------
From: ilist
To: informix-list
Subject: Re: Getting data to a file, and divide by zero
Date: Thursday, 9 November 1995 7:13PM
Thanks for your answers. UNLOAD works dandy-fine, and I haven't tried the
union for the divide by sero.
And now, if I may, a follow-up question:
How do I run this SQL script from the command line? I want this unload to
run every morning. Obviously, I'm not going to come in at 3 in the
morning and run isql, I want to have a cron job do this for me.
Thanks again!
Niel
--
|-------------------------------------------------------------------|
| Niel M. Bornstein nbornstein@plr.com |
| nbornstein@prubank.com |
---------------------------------------------------------------------
| Visit me at http://www.ticllc.net/home/niel/publicHome.html |
---------------------------------------------------------------------
| "Not all dinosaurs roll over and die. Some of 'em can run real |
| fast and bite the hell out of you." -- Anonymous, Wired |
|-------------------------------------------------------------------|