Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: HELP:The columns of primary key?
GengBo <bgeng_at_szdhd.sz.lucent.com> wrote in message news:<3B9C2981.AEEB8916_at_szdhd.sz.lucent.com>...
> Hi, All,
>
> Could expert tell me how to check the columns of primary key? The table is not
> created by myself , so I don't know how primary key composed.
>
> Thanks,
> Bob
>
> --
This task can be answered by using the rdbms dictionary. Here is a link to a general article on using the dictionary: http://www.jlcomp.demon.co.uk/faq/ind_faq.html#DBA%20and%20general%20server%20technology
The title of the article is: How do I find information about a database object: table, index, constraint, view, etc... in Oracle ? should you have any trouble following the link.
Look at dba_indexes for all indexes on the table, then
look at dba_ind_columns to see what columns make up the indexes on the
table
The indexes may or may not be part of a declared PK. Look at
dba_constraints for this information. The constraint_type = 'P' would
be a PK.
![]() |
![]() |