still waiting
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: still waiting

  1. #1
    Join Date
    Jul 2000
    Location
    india
    Posts
    213
    Hi Eveybody,
    Can anybody help in deleting the master records as well as the detail records with the help of the single query.
    While designing the detail table i have not mentioned the
    ON DELETE CASCADE option.
    Pls help
    thanks in advance
    pras

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    It doesn't matter if you haven't specified ON DELETE CASCADE when you created your FK constraints. Yo can drop your FK constraint and recreate it with the ON DELETE CASCADE option. I can't see any problem here.

    The other option you have is to put a PRE DELETE row trigger on your master table that will delete coresponding child rows from your detail table.

    You can't directly delete records from more than one table with a single delete statement.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    Jul 2000
    Location
    india
    Posts
    213

    Thumbs up thanks

    Hi

    Thanks a lot jmodic.I just wanted to know if i do not provide
    ON DELETE CASCADE option whether it is possible to delete from both the tables.
    And now i got the answer that u can't using a single delete statement .

    Thanks again.
    pras

Posting Permissions

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


Click Here to Expand Forum to Full Width