resetting SERIAL columns (was Re: <No Subject Supplied>)
Posted in 1993
In article <1pqp7pINN86u@emory.mathcs.emory.edu> mark@cdin-1.compu.com (Mark Heringslake) writes: > 1) I have a table that has a SERIAL field. For conversion purposes > I force inserted (via SQL) a row w/ a value of -1 (which I use for > any record that doesn't convert right). It took it and I can view > the data via SQL, but none of the other programs seem to "see" > this record. NOTE: This is NOT a problem, just curious as to why > it seems to be invisible. It shouldn't be, and isn't in my tests. Are you sure you aren't applying any WHERE conditions? > c) Somewhat unrelated..... > How do I get the "serial" value to start over - do I have to > alter the table to remove the "serial" field and then alter it > again back to "serial"? I don't think you can alter any column to a SERIAL type. Instead, you gotta: 1) insert with serial_col = 2147483646 2) insert with serial_col = 0 3) insert with serial_col = 0 again The third insert will have serial_col == 1. >* Mark E. Heringslake Phone (215) 824-3000 extension 249 * -- Alan Denney aland@informix.com {pyramid|uunet}!infmx!aland Disclaimer: Poster under influence of 1,3,7-trimethylxanthine "Lawyers use numbers like a drunk uses a lamppost: for *support*, rather than *illumination*." -- Peter Grace