|
|
Re: Sql query to get the primary key column of the table [message #193521 is a reply to message #193511] |
Mon, 18 September 2006 01:58 |
vghooli
Messages: 1 Registered: September 2006 Location: Bangalore
|
Junior Member |
|
|
Hi Manish,
Plesae find below query, I think it will help you.
SELECT A.CONSTRAINT_NAME, A.TABLE_NAME, B.COLUMN_NAME FROM DBA_CONSTRAINTS A, DBA_CONS_COLUMNS B
WHERE A.owner = <SCHEMA_USER_NAME> AND B.owner = <SCHEMA_USER_NAME> AND A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
AND A.constraint_type = 'P' ORDER BY A.CONSTRAINT_NAME
You need to enter Schema User Name.
Vasant
|
|
|
|