ADSM-L

Testing the day of week in a script ....

2002-10-21 05:54:51
Subject: Testing the day of week in a script ....
From: PAC Brion Arnaud <Arnaud.Brion AT PANALPINA DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Mon, 21 Oct 2002 11:39:12 +0200
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       | 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

<Prev in Thread] Current Thread [Next in Thread>