Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: More Newbie help, displaying primary keys.
Hi,
How about combining dba_constraints with dba_cons_columns? Something like this should get most of the information you need:
SELECT U.CONSTRAINT_NAME,U.CONSTRAINT_TYPE, U.R_CONSTRAINT_NAME,U.DELETE_RULE,C.COLUMN_NAME FROM DBA_CONSTRAINTS U, DBA_CONS_COLUMNS C WHERE U.CONSTRAINT_NAME = C.CONSTRAINT_NAME; You can include different columns as you see fit..if you've followed constraint naming conventions this will also infer the parent tables for foreign keys.
Hope this helps,
Steve
In article <yv2d6.9797$KP3.3181320_at_news3.rdc1.on.home.com>,
"MadG" <patrick4133_at_hotmail.com> wrote:
> I must display the following:
>
> primary and foreign keys on the table (constraint name, column name,
type of
> constraint, parent table (for foreign keys), and delete rule (for
foreign
> keys): use the views: PRIMARY_KEYS and FOREIGN_KEYS
>
> But I can't seem to get it to work... I haven't got the syntax for the
view
> commands with primary_keys I get back stuff like this.
>
> Usage: DESCRIBE [schema.]object[@db_link]
>
> I am lost and afraid :)
>
> A little help?
>
> Thanks in advance (again)!
>
>
Sent via Deja.com
http://www.deja.com/
Received on Mon Jan 29 2001 - 07:24:06 CST