Question : finding PK of table through pl-sql code

is there any command that can be run on tables to quickly display the PK of the table.

thanks

Answer : finding PK of table through pl-sql code

Use the following query, if you can login as the schema owner.

SELECT * FROM user_constraints
WHERE constraint_type ='P'
/

Otherwise, as DBA please use the following query.

SELECT * FROM dba_constraints
WHERE constraint_type ='P'
AND owner = '<schema name>'
/
Random Solutions  
 
programming4us programming4us