Re: automatic unique key genration

From: Scott Urman <surman_at_oracle.com>
Date: 1995/11/22
Message-ID: <4906vs$sd0_at_inet-nntp-gw-1.us.oracle.com>#1/1


In article <Pine.SOL.3.91.951122143325.25795D-100000_at_nova>, Michael Hollingsworth <mholling_at_nova.umuc.edu> writes:
|> From: Michael Hollingsworth <mholling_at_nova.umuc.edu>
|> Newsgroups: comp.databases.oracle
|> Subject: automatic unique key genration
|> Date: Wed, 22 Nov 1995 14:35:36 -0500
|> Organization: University of Maryland University College
|> Lines: 15
|> Message-ID: <Pine.SOL.3.91.951122143325.25795D-100000_at_nova>
|> NNTP-Posting-Host: nova.umuc.edu
|> Mime-Version: 1.0
|> Content-Type: TEXT/PLAIN; charset=US-ASCII
|> X-Sender: mholling_at_nova
|>
|> Does anyone know if oracle supports automatic key generation. I
|> would like to have the primary key generated automatically as part of a
|> trigger whenever a record is inserted. I know that some databases have
|> this object/function built in as part of their SQL extensions.
|>
|> My company is moving to client/server and this feature would be nice.
|>
|> Thanks for any info.
|>
|> Mike
|>
|>
|> ***************************************************************************
|> Michael Hollingsworth mholling_at_nova.umuc.edu
|>
Yep. Oracle implements sequences. You can set up something like create or replace sequence keys
  start with 1
  increment by 10;
then reference keys.nextval in a trigger (or elsewhere). Received on Wed Nov 22 1995 - 00:00:00 CET

Original text of this message