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: Non working sequence

Re: Non working sequence

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 15 Oct 1999 08:49:12 -0400
Message-ID: <sSIHOLK=7MI2E178POwyLSJs9yf5@4ax.com>


A copy of this was sent to buurd_at_my-deja.com (if that email address didn't require changing) On Fri, 15 Oct 1999 07:11:39 GMT, you wrote:

>Hi!
>
>If I have understood correct this should result in that "mytable.id"
>has two different numbers:
>
>create sequence myseq;
>
>insert into adress(id) values(myseq.nextval);
>insert into adress(id) values(myseq.nextval);
>
>ORA-00001: unique constraint (ROLAND.ADRESS_ID_PRIM) violated
>
>select id from adress;
>
>id
>--
> 0
>
>Q1: Why is id = 0?? myseq has a minimum of 1.
>Q2: Why doesn't myseq.nextval update the number??
>
>When I created a dummy-table without the primary-key myseq works fine.
>But not on the adress-table.
>
>Tia

look for a trigger on the adress table. i'll bet it has a line of code like:

:new.id := 0;

in it.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Oct 15 1999 - 07:49:12 CDT

Original text of this message

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