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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Retrieving records in order they were placed.

Re: Retrieving records in order they were placed.

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Sun, 11 Jul 1999 20:38:00 +0800
Message-ID: <37889028.2BF1@yahoo.com>


Jessica Nocerino wrote:
>
> Kenneth C Stahl wrote:
> >
> > The sequence numbers would only wrap if the counter is too small. Oracle is
> > capable of some pretty large numbers. If you define the sequence number as a
> > column defined simply as NUMBER I bet it would take you a couple of
> > lifetimes before it will wrap.
> >
> > Ken
> >
> > b_rich2_at_my-deja.com wrote:
> >
> > > I have to put records into a table, and later retrieve them in the order
> > > in which they were placed. I have a very very large number of entries to
> > > be placed in a live system. The records are logs of important events in
> > > the system.
> > >
> > > My first thought was to use the unix time stamp to place as the field to
> > > order on, but there will probably be many entries entered in rapid
> > > succession. Thus many entries could be entered at the same time stamp
> > > interval.
> > >
> > > I then though of having a sequence number associated with each record,
> > > increasing one by one with each record stored. This will work well until
> > > the sequence numbers begin to wrap. If they are retrieved in order of
> > > sequence number, and then they wrap, the records entered after the wrap
> > > (sequences 1,2,3,4 etc) will all of a sudden be pulled out before the
> > > earlier records with high sequence numbers.
> > >
> > > Another idea is to just use the sequence numbers, and re-boot the box
> > > every few weeks when the sequence numbers get high, but this is really
> > > unacceptable in the environment where this will be run.
> > >
> > > Does anyone know how to get around this problem? Any help would be
> > > GREATLY appreciated.
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Share what you know. Learn what you don't.
>
> Using sysdate in a column to timestamp the entrys would also work b/c
> time goes down to ms. it may physically only show date and basic time,
> but time is recorded down to the ms. And when you run a query it uses
> that precision to sort the records

Hi Jessica,

I am pretty sure that dates only go down to the second...

You can use dbms_utility.get_time to get a hundredth's of a second style of timing or sequences...

Cheers
Connor
--



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Sun Jul 11 1999 - 07:38:00 CDT

Original text of this message

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