Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Cannot create Trigger, won't show me errors
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
![]() |
![]() |