Re: RowID Question (Part 2)
Posted in 1992
thomas,
}>I think that what you want to be cdone can be done. Here's
}>some pseudocode:
}>
}> alter table tab adding column id of type int;
}>
}> insert into tab(id)
}> select rowid from tab;
}>
}> alter table tab, modify id to type serial;
}>
}> create unique index ix on tab(id);
}>
}> unload tab from old_db;
}> load tab into new_db;
}>
}>
}>This gives you the tie between old and new databases, but requires
}>you modify inserts to have a 0 in the id column (this triggers an
}>insert of the next serial value).
}>
}>Sorry, no manual handy, syntax stinks!
}>
if no updating is going on while attempting to verify the data,
the following unload would work without altering the table:
unload to "ascii.file"
select rowid,*
from tab;
------------------------------------------------------------------------------
Bob Baskett
Motorola, Inc.