Brain freeze doing Date comparisons

From: Bill Ferguson <wbfergus_at_gmail.com>
Date: Thu, 26 Feb 2009 07:57:12 -0700
Message-ID: <4025610e0902260657g710c573fxf6c174006b7ef8b4_at_mail.gmail.com>



Hi all,

Dealing with management has made my brain freeze and I'm stumped.

I have a table as :
dep_id number -- my primary key for most tables in system xml_clob --manually generated clob field update_date timestamp -- when this record was added updated_by varchar2(30) --userid of person

Management wants a 'robust' auditing system in place, so my approach is if a piece of data in any table for a particular record has been changed or added, etc., then I'll copy my current xml_clob field from my master search table (which is always up-to-date) into this other table. But, I only want to do it if this hasn't been done within the last hour. So, in essence, at the most, I'll only have one record in this table for every 60 minutes.

So, my problem is selecting only the most current record in this table (if one exists), and checking to see if it was added within the last 60 minutes.

This is for Oracle 11 on Windows.

Thanks for your help.

--

Received on Thu Feb 26 2009 - 08:57:12 CST

Original text of this message