Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    55

    Unanswered: Alter foreign key not enforced not working

    Running db2 LUW 10.1 fp 2 on Red Hat 5.9.

    Check the foreign keys before a migration, then run an alter table to unenforce the foreign key:
    alter table ACKWORK ALTER FOREIGN KEY FK133_ACKWORK NOT ENFORCED
    DB20000I The SQL command completed successfully.

    Migration fails with a set integrity violation on that same foreign key.

    run a db2look to check the table and find:

    ALTER TABLE "DANG "."ACKWORK"
    ADD CONSTRAINT "FK133_ACKWORK" FOREIGN KEY
    ("BUSINESSID")
    REFERENCES "DANG "."BUSINESSES"
    ("BUSINESSID")
    ON DELETE NO ACTION
    ON UPDATE NO ACTION
    ENFORCED
    ENABLE QUERY OPTIMIZATION;

    Has anybody experienced this?

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Migration fails with a set integrity violation on that same foreign key.
    What actual message(s) did you got?
    Please Copy and Paste the message(s).

Posting Permissions

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