Home » SQL & PL/SQL » SQL & PL/SQL » how to delete the records from master table when it has child relationships
how to delete the records from master table when it has child relationships [message #18812] Fri, 15 February 2002 01:28 Go to next message
ksr
Messages: 112
Registered: January 2002
Senior Member
Hi,
I have a table, and it is a primary table.
It has links to around 6 tables.

Is there any procedure where it will detect all the child relationships and delete one by one and finally the records in the primary table.
I want to delete a few records not all the records in the primary table.
i want to send the input as table name,and the column name with values list.

What should be done and how can i do this..

any help is appreciated..
Re: how to delete the records from master table when it has child relationships [message #18814 is a reply to message #18812] Fri, 15 February 2002 01:55 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
first method
------------
if you have primary key and foreign key relationship then use cascade delete option.in that case you do not have to write any code

second method
-------------
write before delete trigger
Previous Topic: Group By and (SELECT) , oracle newbie question
Next Topic: Let Oracle truncate values on INSERT autom. ?
Goto Forum:
  


Current Time: Tue Apr 23 14:10:28 CDT 2024