Re: Q: easy: changing serial value manually
Posted in 1996
Topics: General Discussion
This is the point 5.9 of the FAQ'S:
5.9 How to alter the next SERIAL number
Jonathan Leffler (johnl@informix.com) #include :
To change the next inserted serial number to a value greater than its
current value you can:
ALTER TABLE...MODIFY( ser_col_name SERIAL([new_start_number])
To change the next inserted serial number to a value LESS than its
current value you need to first reset the
serial number to 1:
INSERT INTO table (serial_column) VALUES (2147483647);
INSERT INTO table (serial_column) VALUES (0); -- Back to 1 again!
...then perform an ALTER TABLE (as described above).
Marc Kneppers wrote:
}
} Hi,
}
} This should be easy, but.....
}
} Can someone give me a quick how-to for changing the value of a serial
} column manually?
}
} I've checked all my manuals and I can't seem to get the syntax down.
} This is accepted but doesn't work:
}
} alter table employee
} modify employeeno serial(579)
}
} (I'm trying to change it to 579 - there are no values higher than this).
}
} Thanks
} Marc
} --------------------------------------------------------------------------
} Marc Kneppers
} System Administrator and Everything-Under-the-Sun-guy
} PAMCO
} marc@pamco.com
} --------------------------------------------------------------------------
} "Kiss my Royal Canadian"