ADSM-L

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

2002-10-21 07:25:51
Subject: Re: 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 13:17:17 +0200
Hi Hans,

And thanks a lot, you saved me lots of time !

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



-----Original Message-----
From: Hans Hedlund [mailto:Hans.Hedlund AT ENSKILDA DOT SE] 
Sent: Monday, 21 October, 2002 12:48
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Re: Testing the day of week in a script ....


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>