ADSM-L

Re: Need reference for SELECT statement syntax

1998-09-16 20:25:52
Subject: Re: Need reference for SELECT statement syntax
From: "Thomas A. La Porte" <tlaporte AT ANIM.DREAMWORKS DOT COM>
Date: Wed, 16 Sep 1998 17:25:52 -0700
Bob,

Any standard SQL reference will do, as I believe ADSM simply
conforms to the SQL standard with no additional fanciness added.
As you've noticed, the basic ADSM docs don't go into much detail
on this topic--would that I could I'd be in Germany next week to
see Andy's talk on the SELECT interface!

As far as "DATEADD", I'm not sure what that is, but you should be
able to do arithmetic with dates (e.g. add two dates, subtract
one date from another) without any special functions, you'll just
need to CAST the result into something meaningful (number of
days, number of hours, etc.).

For example, we run a schedule in the morning to get a list of
nodes who have missed a schedule within the last eight hours by
issuing the following SELECT statement:

SELECT message \
FROM   actlog \
WHERE  msgno = cast('2578' as integer)  \
AND    cast((current_timestamp-date_time)hours as decimal(8,0)) < 8

Notice it just subtracts the date_time field of the ACTLOG table
from the current_timestamp in hours, and casts the result of that
subtraction into a decimal which can be compared to an arbitrary
number (in our case, 8).

On Wed, 16 Sep 1998, Bob Brazner wrote:

>Where can I find definitive reference material for supported functions
>used in the SELECT statement syntax.  I'm especially interested in
>functions for manipulating dates and need something beyond what CAST can
>provide.  Is there anything like DATEADD?
>
<Prev in Thread] Current Thread [Next in Thread>