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 -> Working with sequence for generating PK

Working with sequence for generating PK

From: Joel Bergeron <*_bergeronj_at_consultik.com>
Date: Wed, 14 Apr 1999 07:27:12 -0400
Message-ID: <7f1tsf$cfj$1@news.quebectel.com>


I use sequence for creating my pk's but when i'm uploading data in some tables without using sequence (i force my owne pk) i have some problem when the sequence is equal to a number that exist in the table.

Is it possible to skip a number that already exist in the table?

i use a trigger like this one :

CREATE OR REPLACE TRIGGER GENCLIENTTYPEID BEFORE INSERT ON RMSCLIENTTYPE
REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW BEGIN
    SELECT seq_ClientTypeID.nextval

      INTO :new.ClientTypeID
      FROM dual;

END GenClientTypeID; Received on Wed Apr 14 1999 - 06:27:12 CDT

Original text of this message

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