AW: Constraint violation in spite of trigger with sequence
From: A. Stiebing <stiebing_at_softcontract.de>
Date: Tue, 2 Feb 2010 14:11:32 +0100
Message-ID: <C4281E47631142F4B88B737110A916C1_at_as>
Sorry, I forgot to mention that.
The error had been:
Date: Tue, 2 Feb 2010 14:11:32 +0100
Message-ID: <C4281E47631142F4B88B737110A916C1_at_as>
Sorry, I forgot to mention that.
The error had been:
ORA-00001: unique constraint (FOO_NUM) violated
Thanks
Von: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] Im Auftrag von chet justice
Gesendet: Dienstag, 2. Februar 2010 14:02 An: stiebing_at_softcontract.de Cc: oracle-l_at_freelists.org Betreff: Re: Constraint violation in spite of trigger with sequence What kind of constraint violation? You don't mention it. Check(Not Null)? Unique Key? Parent Key not found?
chet
chet justice
813.863.1213 http://oraclenerd.com http://www.linkedin.com/in/chetjustice On Tue, Feb 2, 2010 at 5:09 AM, A. Stiebing<stiebing_at_softcontract.de> wrote:
Hi all,
hopefully someone can give me a hint in the correct direction regarding a
constraint problem:
In spite of we got an trigger with a sequence to update an unique id key on
insert, we get constraint violations from time to time. Where could the cause be for that? Oracle 9 -- select max(num) from auft;
-- -> 52013
create sequence s_po_number NOMAXVALUE increment by 1 start with 52014 cache 20 noorder nocycle; trigger TI_AUFT before insert on AUFT referencing old as old new as new for each row begin -- (...) select s_po_number.nextval into :new.num from dual; if(:new.creationdate is null and :new.createdby is null) then -- (...) end; -- Best regards A. Stiebing
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Feb 02 2010 - 07:11:32 CST