Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2003
    Location
    India
    Posts
    28

    Post Unanswered: DELETE Statement

    Is there any way to delete data in more than one table using a single DELETE statement.

    Actually my req. is deleting rows in all the child tables based a criteria. I know I could do it with multiple DELETE calls, but I am just looking for any better way of doing it.

    Thanks
    Sateesh.

  2. #2
    Join Date
    Jan 2004
    Posts
    370
    There is no multiple table delete statement in Oracle.
    Only multiple table inserts in Oracle9i

  3. #3
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    foreign keys on the child tables with cascade delete

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: DELETE Statement

    No, a DELETE statement can only request to delete from one table.

    However, if you always want to delete from child tables whenever the parent table record is deleted, use ON DELETE CASCADE in the foreign key definition.

  5. #5
    Join Date
    Nov 2003
    Location
    India
    Posts
    28

    Re:

    Thanks for the information.

  6. #6
    Join Date
    Jan 2004
    Location
    Venezuela
    Posts
    151

    Re: DELETE Statement

    Originally posted by n_sateesh
    Is there any way to delete data in more than one table using a single DELETE statement.

    Actually my req. is deleting rows in all the child tables based a criteria. I know I could do it with multiple DELETE calls, but I am just looking for any better way of doing it.

    Thanks
    Sateesh.
    There is a way where you can create a view on the table with check option aand you can create a trigger kind "INSTEAD OF" and through that way you can carry out deletes in several tables with only one sentence.
    Joel Pérez

Posting Permissions

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