Hi *SM'ers,
I'm looking for an SQL command to check the current day of week, before
starting the conditional excution of a subsequent script. I already found
something that seems to work, looking like :
Script blah ...
select date_time, message from actlog where cast((current_timestamp-date_time)
minutes as decimal(8,0)) < 1 and dayname(date_time) = 'Tuesday'
if(rc_ok) goto tuesday
If (rc_notfound) goto restofweek
tuesday :
run script1
exit
restofweek :
run script2
exit
Unfortunately this kind of select statement take ages to complete, because it
has to go through all the activity log to find the last lines written, as we
keep one month of it !
Does anybody have a faster way doing this kind of query/test ? (without
calling an AIX script)
Thanks in advance ....
Cheers.
Arnaud
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| Arnaud Brion, Panalpina Management Ltd., IT Group |
| Viaduktstrasse 42, P.O. Box, 4002 Basel - Switzerland |
| Phone: +41 61 226 19 78 / Fax: +41 61 226 17 01 |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|