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: Creating IDs subsequently

Re: Creating IDs subsequently

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 22 Jul 2003 07:01:34 -0700
Message-ID: <2687bb95.0307220601.12228e32@posting.google.com>


"Gerd Forster" <gf_at_nospam.at> wrote in message news:<bfiu6q$f83qv$1_at_ID-119152.news.uni-berlin.de>...
> "Mark D Powell" <Mark.Powell_at_eds.com> schrieb im Newsbeitrag
> news:2687bb95.0307210545.24641c9b_at_posting.google.com...
> > "Gerd Forster" <gf_at_nospam.at> wrote in message
> news:<bfgek8$e117p$1_at_ID-119152.news.uni-berlin.de>...
> > > Hello everybody,
> > >
> > > I have a table with timestamp and other information.
> > > Recently I added a numeric ID column.
> > >
> > > I want to fill in IDs in CHRONOLOGIC ORDER.
> > >
> > > Is this possible by an update statement, or do I have to write
> > > a procedure?
> > >
> > > Thanks in advance
> > > Gerd Forster
> >
> > Gerd, this is from the version 9.2 DBA Admin manual, "Sequences are
> > database objects from which multiple users can generate unique
> > integers." There is a chapter on managing them in the Admin manual
> > and it refer readers to the Concepts manual for more information.
> > Perhaps a sequence generator (create sequence command in SQL manual)
> > will fit your bill.
> >
> > If you want true CHRONOLOGIC ORDER what was wrong with using the
> > timestamp as the key?
> >
> > HTH -- Mark D Powell --
>
> Hi Mark,
>
> I'm sorry, I did not mention that I am Using Oracle 8.
> And there is only the DATE type and SYSDATE, which is not able to
> generate unique keys.
> So "chronolgic order" is only an approximation.
>
> Thank you very much for your posting!
> Gerd Forster

Gerd, a sequence is probably a good option, but another might be to add another column populated with the results from a query on v$timer which simulates fractions of a second and use the date plus this column to form a unique key. This method might serve your purposes while eliminating an extra index since a PK on the sequence and an index on the date column will probably be needed.

Just a thought -- Mark D Powell --

if you use a number column you could use the date concatenated to the v$ Received on Tue Jul 22 2003 - 09:01:34 CDT

Original text of this message

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