Columns from primary Key

smouge

Member
HI,

Is it possible to extract the columns that form the primary key of an Oracle table?

I need this information to enhance the just posted sorted routine, so that after sorting the table in a grid the cursor returns to the record before sorting. So I wnat to to a search to place the cursor on the same record as before sorting.

thanks in advance
 
You can query omething like that

select COLUMN_POSITION, COLUMN_NAME from
sys.all_ind_columns c
where c.index_name =
( SELECT MIN( index_name) FROM sys.all_indexes I WHERE I.OWNER='OWNER' AND I.table_name='TABLE_NAME' and i.uniqueness='UNIQUE')
ORDER BY COLUMN_POSITION

[This message has been edited by dananiev (edited 24 October 2001).]
 
thanks a lot for your example.

Will try this and study your query

Yep, it works, thanks again, would have cost me a lot of time to come to this sql query

[This message has been edited by smouge (edited 24 October 2001).]
 
Back
Top