Re: Data Migration
Posted in 1994
Craig Szczublewski writes > Hi all, I'm running Informix On-Line 5 under AIX 3.2.5 > > Situation: I want to unload information out of a table in one database > and reload it into another databse for testing. There are > two tables I am unloading. One header and the corresponding > detail table. The header table has a serial value for a > doc_no which provides a unique key. The detail table is > linked to the header via that serial doc_no which is contained > in an integer column. > > Problem..: When I reload into the test database, informix will want to > reassign the serial numner in the table for each row I > insert. If that happens, I will loose my link between my > header and detail. > > Question.: I thought of two possible solutions: 1) place a value in the > header table on the test database that has a value in the > doc_no that is 1 less then the values of the data I am about > to load (the data I am about to load is sorted by the doc_no). > Will informix see that value and automatically start with the > right number? 2) alter the structure of the table and replace > a serial value with an integer value, load the data, then > alter the table again to change it back to serial (is this > safe?) > Solution no 2 is a safe way, but when you change the field back to serial you will need to set the starting address. Malcolm Weallans