Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Viewing names of keys in sql plus?
Paul,
You could do this simply by
select * from user_constraints;
and pick out what you are looking for. You could get more sophisticated and
select * from user_constraints where constraint_type='R' or constraint_type='P';
and pick out what you are looking for. Or you could
select * from user_constraints o
where (constraint_type='P' and table_name='your table name in upper case')
or
(constraint_type='R' and 'your table name in upper case' in (select table_name from user_constraints where o.r_constraint_name = constraint_name));
I hope that this helps.
Larry
Paul Sian wrote in message ...
>I am working on a database right now, basically just the framework.
>Anyways there are some things I want to change. I need to drop a table but
>there is a key referenced in another table preventing me from doing that.
>How do I show a list of the primary/foreign keys so I can know what key to
drop?
>Thanks
Received on Mon Sep 14 1998 - 00:00:00 CDT
![]() |
![]() |