If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Failed to import unique key constraint when table is imported

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-11, 02:45
Divya_kamath Divya_kamath is offline
Registered User
 
Join Date: Jan 2011
Posts: 13
Failed to import unique key constraint when table is imported

hi,

When a table with unique key constraint is imported,unique key constraint is missing in the re created table.

As its a limitation of IMPORT utility,unique key constraints are ignored while importing a table.

Reference:
IBM DB2 9.7 for Linux, UNIX and Windows Information Center

Because of application requirement we cannot go for primary key instead of unique key(),do we have any other alternative methods to retain unique key constraint while importing the table?

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 12-05-11, 03:05
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
is it with import and create_into or ??
if the table existed before, take a db2look before dropping the table and after import recreate the constraint..
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 12-05-11, 03:13
Divya_kamath Divya_kamath is offline
Registered User
 
Join Date: Jan 2011
Posts: 13
Thanks for reply..

We are using import utility as follows:

IMPORT FROM EMPLOYEE.SQL OF IXF CREATE INTO ORG.EMPLOYEE

Since in our case exporting and importing instances will be different, db2look will not be helpful.

Do we have other alternatives?
Reply With Quote
  #4 (permalink)  
Old 12-05-11, 03:23
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
"Since in our case exporting and importing instances will be different, db2look will not be helpful."
db2look output is an sql flat file : you can specifiy -t and generate only info for this table
it can be used in any instance
you can even use awk to cut specific statements...
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On