thanx for your help, Helmut
You could also do something like
echo "select count(*) from myTab" | isql -sq <DATABASE>
if you don't want to go to ISQL or DBACCESS to run and sql command.
So if you wish to run this nightly, create a script, set all the needed
environment variable needed by Informix to run, then execute the sql file.
Place this script file in your cron (I'm assuming that you are in Unix).
"Helmut Blass" <helmu...@t-online.de> wrote in message
news:9krt4i$t5c$07$1...@news.t-online.com...
Hi
sorry for the late answer
If this is NT - I cannot help, someone else please ?
If it is UNIX or dervate - yes, here goes:
Check where your environment variables are set
Can be /etc/profile, can be an init script
Look where INFORMIXSERVER and friends are getting their values
In a shell you can run dbaccess like this:
(I assume sh or ksh as shell)
. environment_for_informix.sh # this line starts with <dot><blank>
# this script sets up all the environment
# variables INFORMIX will need
dbaccess <databasename> <<EoF >output_goes_here
2>errors_and_techie_output_goes_here
set isolation to ..... ;
.........
set lock mode to ..... ;
........
select ...
.... ${Variables} will be replaced by the shell
...
;
EoF
Now it is IMPORTANT, that 'EoF' or whatever string you put after '<<'
into
the first line is exactly the same string here AND starts in column 1
no indentation here! (This is called inplace shell input - a standard
shell feature)
If you put these lines into a file and make it executable you can test
it
from your terminal. I do assume here that this test only select
things, or
in other words, can be repeated
Now if it does what you want you place it into cron.
man cron will tell you all the details.
And you must consider that cron only knows about environment
variables, if
you explicitely set them. This is what the line starting with <dot>
does by
sourcing a script file
Typical line in there are:
INFORMIXSERVER=myserver
export INFORMIXSERVER
and so on
HTH
Dic_k
Another shameless plug from mla:
Magic is REAL unless declared INTEGER
--
Richard Kofler
T-Systems
debis Systemhaus Austria / Vienna
on a private e-mail account
$INFORMIXDIR/bin/dbaccess databaseName <<EOF
select amount from inventory where itemDescription = "baseball"
EOF
Jim
On Fri, 17 Aug 2001 14:37:59 +0300, in article
<9livnh$9b3f1$1...@ID-79143.news.dfncis.de>, Leonid Vorontsov stated...
What job you choose to run at a certain time is up to you. SQL Editor
has a bunch of parameter flags to run it in a pseudo dbaccess mode.
If your environment is set correctly, you should be able to call
dbaccess.exe. Also, look in %INFORMIXDIR%\bin for .cmd and .bat files
which create the demo databases for ideas how to create SQL scripts.
Brad Patterson
Jim dJ <nos...@newsranger.com> wrote in message news:<Wpaf7.4797$2u.4...@www.newsranger.com>...