Hi,
How do I determine if a primary Key exists on a particular table and if yes on which columns.
Printable View
Hi,
How do I determine if a primary Key exists on a particular table and if yes on which columns.
select * from dba_constraints where table_name = '' and constraint_type = 'P'
select * from dba_cons_columns where table_name = ''
-Ken
[Edited by KenEwald on 03-13-2002 at 10:46 AM]
Hi Ronnie,
You shall check the dba_constraints the column constraint_type(if it is P, then it is primary key) for this table.
And with the PK name you shall query the all_cons_columns for the column_name for this pk.
Regards
Angel