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: Cannot create Trigger, won't show me errors

Re: Cannot create Trigger, won't show me errors

From: DA Morgan <damorgan_at_psoug.org>
Date: Sun, 16 Oct 2005 11:23:50 -0700
Message-ID: <1129487029.32499@yasure>


Marian Aldenhövel wrote:

> What I am trying is something like:
>
> CREATE OR REPLACE TRIGGER CMS.TRG_ARCHIVE_BI0
> BEFORE INSERT ON CMS.ARCHIVE
> FOR EACH ROW
> BEGIN
> IF ( NVL(:NEW.RECID,0)=0 ) THEN
> SELECT CMS.GEN_GENERAL.NEXTVAL INTO :NEW.RECID FROM DUAL
> END IF;
> END;
Others have told you how to find the error message. But I wonder why the IF statement? If someone is providing a RECID it will, sooner or later, cause a primary key violation with your sequence. Don't let anyone enter a value and always use the sequence.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Sun Oct 16 2005 - 13:23:50 CDT

Original text of this message

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