Re: SERIAL data type
Posted in 1995
On Jun 22, 7:56pm, DONALD BOOTHBY wrote:
> Subject: Re: SERIAL data type
> >........................................I do an alter table where
> >the only thing changed is the starting value of the serial field.
>
> When I altered the serial field to change the starting value IT DID
> NOT change it. The next INSERT was +1 from the last INSERT. I
> deleted all the rows, so it doesn't use MAX(serial column+1) to figure
> it out. It must keep the value internally. Besides, if it did this,
> it wouldn't roll over to 1. (I tested this using Informix 6.00.UE1.)
> So, if it does keep the value internally, why doesn't it reset with
> the ALTER TABLE MODIFY (col01 SERIAL(300))? Beats me. I would just
> be cautious about your application and test things you're not sure
> about. Testing some of this stuff on Informix woke me up to a number
> of things.
Donald,
I ran the following test on Online 7.10.UC2.
create table jg(a serial);
insert into jg values (0);
insert into jg values (1000);
insert into jg values (1000);
insert into jg values (0);
insert into jg values (0);
alter table jg modify a serial(2000);
insert into jg values (0);
insert into jg values (0);
insert into jg values (100);
insert into jg values (0);
Results were:
1
1000
1000
1001
1002
2000
2001
100
2002
as expected. I no longer have access to V6 so if this does not work on V6
please report it both to Informix and the net.
Thanks - Jim
--
-----------------------------------------------------------------------------
Jim Gordon DHL Airways Inc. jgordon@us.dhl.com
-----------------------------------------------------------------------------
My opinions are my own. They may vary with time but they remain mine!