ADSM-L

Re: Scripting question

2005-01-20 12:35:43
Subject: Re: Scripting question
From: Andrew Raibeck <storman AT US.IBM DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 20 Jan 2005 10:35:27 -0700
Yes.... actually I think I got the idea from you, Wanda.

The workaround I like is to add a WHERE clause like this:

   where scheduled_start >= '1900-01-01'

For example:

select node_name, schedule_name, scheduled_start, status -
   from events -
   where scheduled_start >= '1900-01-01' and -
         scheduled_start >= current_timestamp - 24 hours

Regards,

Andy

Andy Raibeck
IBM Software Group
Tivoli Storage Manager Client Development
Internal Notes e-mail: Andrew Raibeck/Tucson/IBM@IBMUS
Internet e-mail: storman AT us.ibm DOT com

The only dumb question is the one that goes unasked.
The command line is your friend.
"Good enough" is the enemy of excellence.

"ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU> wrote on 01/20/2005
10:22:03:

> Andrew Raibeck posted on this problem a while back.  I don't remember
> exactly where to find that post, but I remember the problem is not your
> WHERE, it has something to do with the fact that the EVENTS table is
> unlike other tables.
>
> It works if you put in a constant date, as you found.  So you can fool
> it by using a combination of bogus constants and relative timestamps,
> like this:
>
> select schedule_name, date(scheduled_start), status from events where
>    scheduled_start between '2003-12-01' and '2020-12-31' and
>    scheduled_start  >= current_timestamp-24 hours
>
> -----Original Message-----
> From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf 
> Of
> David Moore
> Sent: Thursday, January 20, 2005 11:05 AM
> To: ADSM-L AT VM.MARIST DOT EDU
> Subject: Scripting question
>
>
> Hello List -
>
> My goal is to script a customized report in the Operational Reporting
> tool, to report backup information for selected nodes to specific email
> recipients (the nodes are differentiated by the node-contact field).
>
> My problem is that a straight select on the EVENTS table is only pulling
> back results that occurred since midnight.  Then, when I try to insert a
> WHERE clause (WHERE SCHEDULED_START >= CURRENT_TIMESTAMP - 24 HOURS), I
> get a RC=11 (no match).  With trial & error, if I hard-code the previous
> day (WHERE SCHEDULED_START >= '2005-01-19 17:00'), I receive the results
> I'm looking for.  But, I need this in script form with no hard-coding,
> since it will run automatically.
>
> I've also investigated the use of a Q EVENT * * clause, but I can't use
> it, because I can't key on the CONTACT field off the NODES table (I
> could hard-code the specific nodes, but that changes relatively often,
> so that's not a fool-proof method for my site).
>
> Does anyone have a solution to this problem, either through the use of a
> variable or a TIME field that will compare to the SCHEDULED_START field?
> Remember, it needs to be a straight SELECT statement that runs through
> the Operational Reporting tool.
>
> Thanks, in advance and have a happy Mardi Gras.
>
> David Moore
> State of Louisiana

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