Re: Data Migration
Posted in 1994
Jonathan Leffler writes: |> |> Misconception: |> SERIAL columns always assign new values. Additional misconception: SERIAL columns are guaranteed to be unique. |> |> Actuality: |> SERIAL columns are INTEGER columns with the special property that |> if you try to insert the value 0 (zero), you get a positive value |> greater than zero that is one larger than the largest value ever |> stored in the column in this table. Additional actuality: When tables are created via ISED (Interactive Schema Editor, the "Tables" option of ISQL), selecting SERIAL as thee data type will result in ISED creating a unique index on that column. If you create your table via SQL, unless you explicitly put a unique index on the column, there is no guarantee of the uniqueness of the serial data (a unique constraint would work, but that is just another way of creating a unique index). Jonathan mentioned wrapping of serial values - w/o the unique index, this has the potential for duplicate serial values being introduced into a table (assuming that the serial value has wrapped). Dave Kosenko Disclaimer: The opinions expressed in this message are not those of Informix Software, its partners or lackeys. Anyone who says otherwise is itching for a fight. **************************************************************************** "I look back with some satisfaction on what an idiot I was when I was 25, but when I do that, I'm assuming I'm no longer an idiot." - Andy Rooney