RE: Err 239 on Insert to serial column
Posted in 1999
What did an "oncheck -pt <db:table>" show for the "current serial value"
before Stuart performed the successfully insert. Perhaps the sysmaster
database
contained incorrect information regarding the last used serial number.
Rick
> -----Original Message-----
> From: Art S. Kagel [mailto:kagel@bloomberg.net]
> Sent: Thursday, October 14, 1999 09:27
> To: informix-list@iiug.org
> Subject: Re: Err 239 on Insert to serial column
>
>
> Everyone is missing Stuart's point!
>
> Let me try Stuart:
>
> He has a table where the MAX(serial_col) = 70650 and where
> the next serial
> value should be 70651. When he tried to insert with
> serial_col = 0 to get
> the next value auto inserted it failed with, an apparently spurious,
> duplicate key error (-239). However when he forced the very
> same value
> into serial_col (ie 70651) it was taken without error showing
> that the
> value was indeed NOT a duplicate! Now when he continued to
> insert using
> serial_col = 0 the sequence continued with the very next
> value, 70652, and
> continues to work without error. He did nothing flaky here
> folk and wants
> to know if any of us has seen the same anomolous behavior.
> So have we?
>
> Honestly, not I. One question, when you say the unique index
> was dropped
> and recreated with "no success" do you mean the rebuild did
> not solve the
> problem or that you could not rebuild the index? I suspect
> the former,
> but I have to ask.
>
> Art S. Kagel
>
> Stuart Worrall wrote:
> >
> > Hello,
> >
> > I have recently been presented with a problem whereby the
> error 239 is
> > generated from dbaccess when trying to insert a row. ie
> INSERT INTO XXXXX
> > VALUES (0,"DDF",1,"etc") where the first column is the serial.> >
> > There is a unique index on the column which was dropped and
> re-created with
> > no success.
> >
> > After further investigation the serial value was found to
> be 70650. I then
> > used the following statement to force the insert..
> INSERT INTO XXXXX
> > VALUES (70651,"DDF",1,"etc") which worked.> >
> > After this, using the value 0 to insert into the serial
> field worked and I
> > was able to put in the values of 70652, 70653 etc.
> >
> > Has anybody seen this problem anywhere else?
> >
> > The system is Dynamic Server 7.3.UC8 running on a HP
> >
> > Thanks in advance
> >
> > Stu Worrall
>