RE: autoincremental field ?? Bug
Posted in 2000
> >Is there a way to make a field of type INTEGER
> autoincremental (like an
> >index)?
>
> SERIAL? You know, I'm in no position to talk, but I think you
> need to RTFM.
:-))
Ok, well I HAVE been reading the manual and I have a related problem.
I have a table with a serial column that has about 400 rows.
The table structure is along the lines of
CERATE TABLE office
(
off_code SERIAL,
some other fields ( descriptions and address only )
);
The table has an index on off_code
SELECT MAX ( off_code ) FROM office; -- returns 636
INSERT INTO office VALUES ( 0, NULL , NULL .... )
SELECT MAX ( off_code ) FROM office; -- returns 654.
I can understand how this happens but to reset it I thought you have to run
DELETE FROM office WHERE off_code > 636;
ALTER TABLE office MODIFY off_code SERIAL(637);
I have tried this so many times that now I'm at about 700.
Is there something that I'm missing or is this a bug?
Informix version IDS 7.30UC3.
OS AIX 4.2
Any help greatly appreciated
Jo
___________________________________________________________________________
This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
Sema Group.
If you are not the intended recipient, be advised that you have received this
email in error and that any use, dissemination, forwarding, printing, or
copying of this email is strictly prohibited.
If you have received this email in error please notify the Sema Group
Helpdesk by telephone on +44 (0) 121 627 5600.
___________________________________________________________________________