Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Viewing names of keys in sql plus?

Re: Viewing names of keys in sql plus?

From: Larry Ragan <cragan_at_erols.com>
Date: 1998/09/14
Message-ID: <6tjuf9$fuf1@grover.prc.com>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US