Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: finding a table's primary key
On Tue, 02 Mar 1999 11:38:37 GMT, jerwynn_at_buyasia.com wrote:
>Is there an SQL or PL/SQL command to query the primary key of a table?
>
>If not, where (in which tables) can I find information
>about the primary keys of tables?
select c.table_name TABLE_NAME, cc.column_name COLUMN_NAME, substr('('||cc.position||')',1,8) POSITION from dba_cons_columns cc, dba_constraints c where c.constraint_name=cc.constraint_name and c.constraint_type='P' Received on Tue Mar 02 1999 - 07:10:21 CST
![]() |
![]() |