Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Find PK column
I'd rather use TOAD in your place.
SF
Kean Jacinta wrote:
>Hi ,
>
>I am trying to get the table primary key and the
>column name. How can i query that.
>
>THis is the result i want :
>
>table_name columns_name constraint_name
>---------- ------------- ---------------
>Material bookid bookid_pk
>
>
>currently i have tried
>
>select u.table_name, u.column_name, c.constraint_name
>from user_tab_columns u, user_constraints c
>where u.table_name=c.user_constraints
>and u.table_name='Material'
>
>I can't get the result correctly
>
>
>
>
>
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Jun 08 2005 - 07:03:43 CDT
![]() |
![]() |