Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Non working sequence
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