ADSM-L

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

2002-10-21 06:48:05
Subject: Re: Testing the day of week in a script ....
From: Hans Hedlund <Hans.Hedlund AT ENSKILDA DOT SE>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Mon, 21 Oct 2002 12:47:33 +0200
This statement should be faster:

select current_timestamp from status where
dayname(current_timestamp)='Tuesday'

--Hans

-----Original Message-----
From: PAC Brion Arnaud [mailto:Arnaud.Brion AT PANALPINA DOT COM]
Sent: Monday, October 21, 2002 11:39 AM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Testing the day of week in a script ....


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       |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

***********************************************************
Confidentiality Notice

The content of this e-mail is intended only for the
confidential use of the person(s) to whom it is addressed.
If the reader of this message is not such a person, you are
hereby notified that you have received this communication
in error and that reading it, copying it, or in any way
disseminating its content to any other person, is strictly
prohibited. If you have received this message in error,
please notify the author by replying to this e-mail
immediately.

===========================================================

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