Joel,

Is LDATE a timestamp? If so, you could create a view just like this:

create view mylib/diff_log as
with t1 as(
select max(ldate) as max_ldate from rjsimage/doclog00
)
select timestampdiff(2,
cast( current_timestamp - max_ldate as char(22)) )
as diff
from t1
;

This would give you the number of seconds after the last LDATE recorded.
Then you could wither check it in your poll program and/or incorporate it
in a BEFORE INSERT trigger...


It would be nice to have an index on LDATE for performance.


HTH,
Luis

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.