Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2011
    Posts
    29

    Unanswered: 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

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Jan 2011
    Posts
    29
    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?

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    "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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •