Constraints [message #126130] |
Fri, 01 July 2005 03:06 |
rc_ashish
Messages: 39 Registered: June 2005 Location: mumbai
|
Member |
|
|
Hi,
I have one master table .
This table is linked to more than 25 tables .
I want to find all dependent table to master table through query.
I want to disable linking between these tables and after that i want to enable those constraints with one query.
Thanks in Advance,
Ashish
|
|
|
|
Re: Constraints [message #126260 is a reply to message #126130] |
Sat, 02 July 2005 03:57 |
shettyshetty
Messages: 18 Registered: June 2005 Location: Malaysia
|
Junior Member |
|
|
Can be done in using SQL statement
Spool the results of the query to a file & execute to disable all dependent constraints. Replace disable with enable to enable all the constraints.
select 'alter table '||owner||'.'||table_name||' disable constraint '||constraint_name||';'
from user_constraints
where r_constraint_name=(select constraint_name from user_constraints where table_name='&MasterTable' and constraint_type='P');
|
|
|