Re: Serial field value resets (continued)
Posted in 1993
It has been pointed out to me that not only was I unspecific, I was also inaccurate, so let me follow Jon Leffler's example and modify or rescind some previous statements. I wrote: >In article <1r3jteINNdtn@emory.mathcs.emory.edu> mark@cdin-1.compu.com writes: > >They [serials] are stored in the partition page for the table, not in the >index. This is true only for OnLine, not for SE, since of course SE has no partition. >> If there ARE records in the file and you ALTER it replacing the >> SERIAL with INTEGER then you global update all the values to 0, >> then ALTER the table back to SERIAL again - will Informix re- >> sequence the records, or will it blow off with a duplicate value >> error? > >1. You cannot alter an integer to a serial. Whoops. I have tested this, and you can in fact alter an integer to a serial. >2. If you could, the serial wouldn't care whether you had duplicates unless you > had a unique index on it. If you had had a unique index on the original > serial, you wouldn't be able to update the integers unless you dropped the > index. This, however, remains true. If you don't have a unique index, you can have duplicate values in your serial. The records are NOT re-sequenced, or blown off with an error. June ----------------------------------------------------------------- June Tong Informix Software, Inc. Regency Support 4100 Bohannon Drive (415) 926-6433 Menlo Park, CA 94025 e-mail: junet@informix.com or uunet!infmx!junet -----------------------------------------------------------------