Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Non working sequence
buurd_at_my-deja.com 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
>
> --
> Roland Carlsson
> Certified Java programmer
> Skövde
> Sweden
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
That's not the way sequences work. Select from them. Your other table
should have
the same problem, that is all values are 0.
--
Met vriendelijke groet/kind regards,
Frank van Bortel
Technical consultant Oracle
Work: Home: ---------------------------------- ---------------------------- V&L Informatica BV Hunzestraat 4 Palatijn 3, 7521 PN Enschede 7555 WB Hengelo PoBox 545, 7500 AM Enschede (31)074-2425046053-4341500 Received on Fri Oct 15 1999 - 14:51:07 CDT