Re: automatic unique key genration

From: Rod Anderson <andersr_at_comtch.iea.com>
Date: 1995/11/25
Message-ID: <497n8c$k3i_at_krel.iea.com>#1/1


: There are some other options (look in the manual or online DOC). The
: DOC says about create sequence: "Create a new sequence suitable for
: generation of primary keys". Sounds like this is exactly what you
: want.
 

: Every time you ask the next value of a sequence you get a number.
: Oracle guarentees that this number won't be given twice, so it's
: guarenteed unique.
 

: Bye,
: Wilfred

The down side is someone may have bypassed the sequence and inserted a duplicate key. In Oracle v6 a unique index is needed or in v7 (I believe) the attribute (column) needs to be unique or one of the other constraints that makes it unique.

Good computing,

   Rod Received on Sat Nov 25 1995 - 00:00:00 CET

Original text of this message