Home » RDBMS Server » Server Administration » Constraints
icon14.gif  Constraints [message #126130] Fri, 01 July 2005 03:06 Go to next message
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 #126179 is a reply to message #126130] Fri, 01 July 2005 06:42 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
You need to use some plsql.
A single query , cannot do this.
Re: Constraints [message #126260 is a reply to message #126130] Sat, 02 July 2005 03:57 Go to previous message
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');


Previous Topic: What are these files GOOD for ?
Next Topic: changing database character set
Goto Forum:
  


Current Time: Fri Sep 27 00:19:20 CDT 2024