Re: How do I view PK and FK Constrain..

From: Frank Greene <74200.427_at_CompuServe.COM>
Date: 8 Dec 1994 02:26:33 GMT
Message-ID: <3c5qsp$2tg$1_at_mhadg.production.compuserve.com>


However, if you just want to get your primary / unique keys, the data is stored in system table ALL_CONSTRAINTS and ALL_CONS_COLUMNS. Try

     SELECT a.constraint_name, b.column_name
     FROM   all_constraints a, all_cons_columns b
     WHERE  a.owner = 'YOUR_ACCOUNT_NAME'
     AND    a.table_name = 'YOUR_TABLE_NAME'
     AND    a.constraint_type in ('U', 'P')
     AND    a.constraint_name = b.constraint_name;
Received on Thu Dec 08 1994 - 03:26:33 CET

Original text of this message