Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Determing the Primary Key from SQL*Plus

james_pApr 2 2008 — edited Apr 2 2008

Which is the easiest way to find the Primary key of a table from SQL*Plus? I can't find any column called 'Column' or 'Column_name' in user_constraints view(10gR2), then how will i know the columns that make up the Primary key?

SQL> DESC USER_CONSTRAINTS
 Name                                   
 --------------------------------
 OWNER                                  
 CONSTRAINT_NAME                        
 CONSTRAINT_TYPE                        
 TABLE_NAME                             
 SEARCH_CONDITION                       
 R_OWNER                                
 R_CONSTRAINT_NAME                      
 DELETE_RULE                            
 STATUS                                 
 DEFERRABLE                             
 DEFERRED                               
 VALIDATED                              
 GENERATED                              
 BAD                                    
 RELY                                   
 LAST_CHANGE                            
 INDEX_OWNER                            
 INDEX_NAME                             
 INVALID                                
 VIEW_RELATED                           
 
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2008
Added on Apr 2 2008
3 comments
296 views