Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2013
    Posts
    2

    Unanswered: problem with deleting rows using on delete cascade

    Hi All,

    Persons(primary key defined) ,Orders(foreign key defined with ON DELETE CASCADE)

    now iam trying to delete the data using LOAD REPLACE Method in parent table

    so,parent table went to Set Integrity pending state"
    when i run the "SET INTEGRITY FOR Persons IMMEDIATE CHECKED"
    Table2 state becomes Set Integrity Pending State"
    Here'if run the "SET INTEGRITY FOR Orders IMMEDIATE CHECKED"
    it is throwing error like
    SQL3603N Integrity processing through the SET INTEGRITY statement has found
    an integrity violation involving a constraint, a unique index, a generated
    column, or an index over an XML column. The associated object is identified by
    "DB2INST1.ORDERS.SQL130518172342680". SQLSTATE=23514

    Please tell me that how do i delete data from parent table and also which deletes rows of child table which refernce to parent table using LOAD not DELETE because it is a large amount of data

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    LOAD REPLACE won't trigger cascading deletes to the child table(s), as you probably realize by now. You can execute a TRUNCATE statement against the child tables, if it's available in your version of DB2. If not, you can LOAD REPLACE into the child tables from /dev/null, which will essentially do the same thing. Dropping and re-creating those tables is also an option.
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    May 2013
    Posts
    1
    agree with upstairs

Posting Permissions

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