Re: Serial Field
Posted in 1994
In article <33ii07$ej0@emory.mathcs.emory.edu>, kurt.vanwagoner@sltrib.com (Kurt Vanwagoner) writes: > Is there a way to reset a serial field to zero, without dropping the > table. Assuming there is no data in the table. I am using Informix > online 5 on a NCR unix box. > I've seen some suggestions to alter the field to integer. While that might work, if the table is REALLY large, it would take a LONG time [and the alter might fail, if you don't have the spare space]. Much easier is to insert a value one less than the max value for a long, then add another record [or maybe two]. Informix will then roll the serial key around to zero. BUT, note that it WILL REASSIGN keys in sequence, so you might get duplicate keys [I think], if you have any old records. [Note, I haven't really tried it, but that's what I was taught in the Admin class a couple of years ago, so all disclaimers apply]. Hope this helps, Ihor Kinal att!cbnewsh!ijk