Results 1 to 4 of 4

Thread: Need Help

  1. #1
    Join Date
    Aug 2013
    Posts
    7

    Unanswered: Need Help

    Can any body help me, i tried to restructure all my data base ad this attached file is the one am stuck into, Mu problem is when i create anew record it will create in all tables connected together which is great but when i delete a record it only delete the record from just one of the tables, maybe i have problem with my linking between the tables.
    thanks for all the help
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    consider using delete cascade when defining relationships, otherwise you will have to delete all records. Delete Cascade is all well and good, but you need to consider when it is appropriate.

    generally ts fine for datathat is volatile and you do no need to keep track of it or fragments over time.

    its not suitable on primary keys in parent tables that define types/prodcuts etc.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    having looked at your data Im guessing you are deleting table site and not table clientProfile.

    delete cascade only works on the current tabel and their child tables that use the same primary key as a foreign key


    so assuming you have a table for orders and a table for order times, linked by the order number inn order details to to orders using the ordernumber as a proiamry key.

    deleting a row in order details will delete only that row
    deleting a row in orders will delete the order AND any rows in order details that have the same primary key.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Aug 2013
    Posts
    7
    can you please show it tome as an example on the file, so that i can see it an understand it better,
    thanks.

Posting Permissions

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