Adding an id column to an existing table
561854May 27 2008 — edited Mar 4 2009I would like to add an id column to an existing table and populate this column for the existing records. For any new inserts I would like to use the next id in sequence.
I believe a sequence and a trigger on insert would be the best way to accomplish the second requirement. I would like to know how to do the first, i.e. handle the existing rows given that I will be using a sequence and trigger for all subsequent rows.
I've never created sequences or triggers before so any advice would be appreciated.
-=beeky