| Message: 63514 |
 |
BY: Philip Nelson (scotdb) DATE: 2009-01-02 11:52 SUBJECT: RE: Moving table to a new database Praveen,
I believe there IS something you can do about this.
There are a three "MODIFIED BY" options available to both LOAD and IMPORT which allow you to work around such problems : they are called IDENTITYMISSING, IDENTITYIGNORE and IDENTITYOVERRIDE.
See the information center link below for more details -
http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=/com.ibm.db2.luw.admin.dm.doc/doc/c0004591.html
In your case, when you have a file containing the identity column values and you want to retain these you would use IDENTITYOVERRIDE -
db2 "load from data.ixf of ixf modified by identityoverride replace into table"
If you used IDENTITYIGNORE it would ignore the values in the load file and generate new values instead, which obviously would not fit in with your foreign keys.
IDENTITYMISSING would be used when you had exported the data without the identity values and you wanted to generate new values. It then assumes that the data in the export file does not include the identity column, so you don't have to give a column list on the load.
You will also want to look at the SET INTEGRITY command as part of the load. You'd use "SET INTEGRITY OFF" before the load and then "SET INTEGRITY IMMEDIATE CHECKED" after the load to clear the "Check Pending" condition.
HTH
Phil Nelson
(teamdba@scotdb.com) | |