Re: how can I determine the primary key for a table?
Date: Mon, 30 Mar 2009 10:44:52 -0700 (PDT)
On Mar 30, 1:28 pm, ddf <orat..._at_msn.com> wrote:
> > How can I determine what column in TABLE_H is the primary key?
> One would use either the USER_IND_COLUMNS view (if you're connected as
> the owner) or the ALL_IND_COLUMNS view (if you're connected as someone
> else) to return the actual column name or names configured as the
> primary key:
> select index_name, column_name
> from all_ind_columns
> where index_name in
> (select index_name
> from all_indexes
> where table_name = 'TABLE_H'
> and uniqueness = 'UNIQUE')
> order by index_name, column_position;
> You'll retrieve one or more rows depending upon how many columns
> comprise the primary key.
Thank you so much. That is just what I was looking for. Received on Mon Mar 30 2009 - 12:44:52 CDT