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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Find PK column

Re: Find PK column

From: <jo_holvoet_at_amis.com>
Date: Wed, 08 Jun 2005 12:57:23 +0200
Message-id: <OFD521AE0A.4DBF4500-ONC125701A.003C1F73@eu.amis.com>

Try user_cons_columns instead of user_tab_columns.

mvg/regards

Jo

                                                                                                                                         
                      Kean Jacinta                                                                                                       
                      <jacintakean_at_yahoo         To:      oracle-l_at_freelists.org                                                         
                      .com>                      cc:                                                                                     
                      Sent by:                   Subject: Find PK column                                                                 
                      oracle-l-bounce_at_fr                                                                                                 
                      eelists.org                                                                                                        
                                                                                                                                         
                                                                                                                                         
                      06/08/2005 12:51                                                                                                   
                      Please respond to                                                                                                  
                      jacintakean                                                                                                        
                                                                                                                                         
                                                                                                                                         




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



Discover Yahoo!
Find restaurants, movies, travel and more fun for the weekend. Check it out!
http://discover.yahoo.com/weekend.html

--

http://www.freelists.org/webpage/oracle-l

--

http://www.freelists.org/webpage/oracle-l Received on Wed Jun 08 2005 - 07:04:49 CDT

Original text of this message

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