Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to implement a circular buffer in a table
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