Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread
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)


Thread View

Thread Author Date
Moving table to a new databaseDavid Adler2009-01-01 23:23
      RE: Moving table to a new databasePraveen Devarao2009-01-02 08:11
            RE: Moving table to a new databasePhilip Nelson2009-01-02 11:52
                  RE: Moving table to a new databasePhilip Nelson2009-01-02 11:58
                        RE: Moving table to a new databasePraveen Devarao2009-01-02 13:06
                        RE: Moving table to a new databaseDavid Adler2009-01-02 14:03
                              RE: Moving table to a new databasePhilip Nelson2009-01-02 14:30

Post a followup to this message