Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: how to implement a circular buffer in a table

Re: how to implement a circular buffer in a table

From: Stephen T. Parfitt <steve.parfitt_at_sympatico.ca>
Date: Wed, 15 Aug 2001 22:44:33 -0400
Message-ID: <3B7B3391.F9A2EE42@sympatico.ca>


Create a SEQUENCE with a MAXVALUE and the CYCLE option ... then use this sequence as the primary key. Presumably, you will need a bit of logic to do INSERTs on the first cycle and UPDATEs thereafter when the circular buffer is overwriting itself - or else initialize the buffer with dummy values beforehand.

oofoof wrote:
>
> I'm looking to design a table that has a fixed size.
> When the table reaches this size, new records added
> to the table will replace the oldest records, thus
> creating a circular buffer. How do I implement this
> efficiently?
Received on Wed Aug 15 2001 - 21:44:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US