Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2003
    Posts
    1,605

    Unanswered: Foreign key - difference between on update: no action and restrict

    Hi,

    I have win2000, db2 v7.2 fixpack 5.

    I was tring out the differences between foreign key option on update no action and on update restrict.
    According to my tests there are no differences between those two options. What is the point of having two options if they work the same?

    Thanks,
    Grofaty

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    My guess would be backward compatibility.

    The manual even states that they work the same.

    Andy

  3. #3
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    What about on delete no action and on delete restrict.
    It seems to be the same reason?

    Thanks,
    Grofaty

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Look at the "CREATE TABLE" statement discussion in the SQL Reference. It says, in particular:

    "A delete or update rule of RESTRICT is enforced before all other constraints including those referential constraints with modifying rules such as CASCADE or SET NULL. A delete or update rule of NO ACTION is enforced after other referential constraints. There are very few cases where this can make a difference during a delete or update."
    ---
    "It does not work" is not a valid problem statement.

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  6. #6
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    Thanks sathyaram_s. The arhive theme is exactly what I was looking for.

    Grofaty

Posting Permissions

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