[Tfug] RDBMS audit trails?
Bexley Hall
bexley401 at yahoo.com
Thu Jul 31 21:12:51 MST 2008
Hi,
> > > > Yes. But, I figure I could treat the
> "log"
> > > table as a
> > > > FIFO and limit its size in the trigger code.
> I had
> > > > assumed something like this would be
> something that
> > > > users would *want* -- even if only for
> testing
> > > > purposes -- hence the question.
> > >
> > > Limiting the size of a table isn't a problem.
> Just
> > > include a datetime
> > > stamp and add an INSERT/UPDATE trigger that
> conditionally
> > > deletes the
> > > oldest records.
> >
> > I figured on being even cruder -- just delete the
> "first"
> > record after adding the "last" record.
> (i.e., initialize
> > the table with N empty records -- where N is the depth
> > of the FIFO you want to preserve)
>
> Uh-uh. Remember - relational database tables are
> unordered. There is
> no "first" or "last" record. You could
"First" is whatever I define to be oldest. *How*
I do that can vary (autonumber, timestamp, updating
my own counter, etc.)
> do an autonumber field but
> those are proprietary and can be wonky. If you're
> going to do this
> (which, again, I think is a very problematic application of
How else can I do this *portably*?
Aside from Oracle, I don't see DBMS's having built-in
audit trail mechanisms...
> NIH), use datetime.
More information about the tfug
mailing list