Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Which cols are part of the primary key?

Re: Which cols are part of the primary key?

From: Alien <stijf_at_stijf.com>
Date: 20 Mar 2006 06:46:36 -0800
Message-ID: <1142865995.921770.78790@v46g2000cwv.googlegroups.com>


Hi,

  1 select a.owner,a.constraint_name,a.table_name,a.column_name   2 from user_cons_columns a, user_constraints b   3 where a.constraint_name=b.constraint_name   4* and b.constraint_type='P'
SQL> / OWNER CONSTRAINT_NAME TABLE_NAME COLUMN_NAME

---------- -------------------- ------------------------------
---------------
SCOTT      PK_DEPT              DEPT                           DEPTNO
SCOTT      PK_EMP               EMP                            EMPNO

SQL> Regards,

Arian Received on Mon Mar 20 2006 - 08:46:36 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US