Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Delete on Multiple Tables

Re: Delete on Multiple Tables

From: <bdbafh_at_gmail.com>
Date: 10 Nov 2005 19:51:33 -0800
Message-ID: <1131681093.766216.196780@g47g2000cwa.googlegroups.com>


if there is a hierarchy, say grandparent, parent, child ... one could put an ON DELETE CASCADE constraint at the parent level to delete the rows in the tables lower in the hierarchy.

another method would be via a trigger on one of the tables ...

create trigger tbd_tablea
before delete on tablea
for each row
begin

   delete clause for table b;
   delete clause for table c;
   commit;
exception handler;
end;

kinda short, but I gotta run.
I'll bet that Dan Morgan has some examples up on his site.

-bdbafh Received on Thu Nov 10 2005 - 21:51:33 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US