Re: Getting data to a file, and divide by zero
Posted in 1995
Niel,
You can use isql or dbaccess. Place your commands into a file
(usually with a .sql extension). Then, redirect the file to your
utility of choice. For example:
isql dbname <script.sql 1>script.out 2>script.err
(You probably also want to mail the results of this to yourself.) Or, if
you just have a single quick-and-dirty command, try:
echo "unload ..." | isql dbname - 1>qd.out 2>qd.err
Finally, if you're going to run this from a cron job, don't forget
about the environment variables! You can change the cron "environment"
to have these set or include the settings in the script which cron
runs.
If you have any specific questions, feel free to write to me direct.
--Craig (craig@chemistry.utah.edu)
>
> 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.
>