Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2009
    Posts
    2

    Unanswered: Deleting a column/row

    Hi Folks,

    How do you delete a column or a row in a production DB with all its child records... Cascade does not work...


    Any suggestions would be helpful,,,,,

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    delete a column --> ALTER TABLE statement

    delete a row --> DELETE statement
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    If cascade doesn't work, you'll have to cascade it yourself - first delete all child records, then delete parent record. Note that this doesn't have to be a simple task if some/all of these child records are parents of other child records (which also might be parents of other children etc.).

  4. #4
    Join Date
    Mar 2009
    Posts
    2

    deleting a column/row

    Thank you for the info folks!!


    Is there anyway apart from going to child by child records(deleting)..

    any one method/procedure.... will be helpful...

  5. #5
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by Raj123123
    Is there anyway apart from going to child by child records(deleting)..
    Define the constraints as ON DELETE CASCADE and Oracle will handle it for you

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Right; but he has already said that "Cascade does not work" (though, didn't specify a reason).

Posting Permissions

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