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 -> Using Sequence and Trigger for Unike fields

Using Sequence and Trigger for Unike fields

From: Eric Jodoin <ejodoin_at_inetex.com>
Date: Mon, 13 Jul 1998 01:46:03 -0700
Message-ID: <35a9cbd1.0@204.239.181.11>


Hi,

 I am trying to create a sequence and a trigger to make afield in my table kind of auto increment. every time a new record is created, a nuw id is inserted in the id field. I got tthe Sequence going easilly but I can't seem to be able to create a Trgger without getting the following error:

MGR-00073: Warning: TRIGGER ¨se.css_user created with compilation errors

The following code is run:

DROP SEQUENCE "CSS_User"."USRID_SEQ" ;

CREATE SEQUENCE "CSS_User"."USRID_SEQ"
INCREMENT BY 1 NOMAXVALUE MINVALUE 1
NOCYCLE CACHE 20 NOORDER ; CREATE OR REPLACE TRIGGER "CSS_User".UserAccess_Bit BEFORE INSERT ON "CSS_User"."USERACCESS" FOR EACH ROW
BEGIN
  IF (:new.usrid IS NULL) THEN

      :new.usrid := USRID_SEQ.next_val
end ;

Please can you help ?

Eric
eric_at_jodoin.com Received on Mon Jul 13 1998 - 03:46:03 CDT

Original text of this message

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