-
hi there,
I was told to enable foreign keys. How do I get a list of them (with status) and enable them?
Thanks,
Nirasha
-
The data dictionary view you want to look at is all_constraints,
I use the following query to spool out a text file that will enable all of my foreign key restraints that have been disabled
select 'alter table SCHEMANAME.' ||table_name|| ' enable constraint '||constraint_name||';'
from all_constraints where owner = 'SCHEMANAME'
and constraint_name NOT LIKE 'SYS%'
Good luck!
-
<font face=courier>
select owner,constraint_name,table_name,r_owner, r_constraint_name,status
from dba_constraints
where constraint_type='R' and owner<>'SYSTEM'
/
</font>
[Edited by sreddy on 01-17-2001 at 01:05 PM]
-
thanks guys,
I used a combination of both of these to create.
select 'alter table FNDRYR0200.' ||table_name|| ' enable constraint '|| constraint_name||';'
from dba_constraints
where constraint_type='R' and owner = 'FNDRYR0200';
It worked real well.
thanks again,
nirasha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|