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

Home -> Community -> Usenet -> c.d.o.server -> Re: Building a primary key

Re: Building a primary key

From: mlarson <mdlarson_at_brain.uccs.edu>
Date: 1997/04/02
Message-ID: <3342FC86.770B@brain.uccs.edu>#1/1

You could build a insert trigger that will make the primary key column something
like max(primarykeyfield)+1. This does the same as a sequence without the chance of losing alot of values. You can also use the DBMS_UTILITY.GET_TIME function in the trigger statement which gives the time up to hundredths of a second.

Read about it on pg511 of PL/SQL ORACLE BOOK (by oracle press)

aramssb_svil wrote:

  Hi there!!!

  I have a question that seem to be simple...

  I have to identify each row in my table with a unique key.

  In which way can i build this key without using a sequence???

  I heard a rumour about using a date, but i can't find the way to   manipulate the date format of Oracle to obtain not seconds but   fractions
  of this.

  If someone have some suggest, please e-mail me or post an answer.

  Thanks in advance

  ---
  Danilo Riccitelli & Andrea Pallotta
  Development Team - Digital Italy Received on Wed Apr 02 1997 - 00:00:00 CST

Original text of this message

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