Re: How to check constraints on Table - DISPLAY

From: AMARENDRA B NETTEM <nettama_at_charlie.cns.iit.edu>
Date: 1997/10/13
Message-ID: <34423164.1DF2_at_charlie.cns.iit.edu>#1/1


Cecil D'Souza wrote:
>
> Hi guys;
>
> I want to see the description of my tabels with the constraints. How do I
> achieve this.
> I have checked all the damn manuals and am stuck. Pl help.
>
> Thank you to Oracle for the fantastic documentation.
>
> Cecil

Try this SQL statement

SELECT B.COLUMN_NAME,B.CONSTRAINT_NAME,DECODE(A.CONSTRAINT_TYPE, 'C', 'CHECK/NOT NULL',
  'P', 'PRIMARY KEY', 'R', 'FOREIGN KEY', 'U', 'UNIQUE KEY')CONSTRAINT_TYPE,a.search_condition
FROM user_constraints A, user_cons_columns B WHERE A.OWNER = B.OWNER

AND A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
AND A.TABLE_NAME = B.TABLE_NAME
AND A.TABLE_NAME = UPPER('&TABLE')

Hope this helps
AMARENDRA

-- 
******************************************************************************
AMARENDRA B NETTEM			5039 N E River Road, Apt. 1A
Certified Oracle DBA			NORRIDGE, IL 60656
Whittman-Hart Inc., 
311 South Wacker Drive, Suite 3500
Chicago, IL 60606.  

Ph.No. (708) 583 9870 (H)  
       (312) 913 6758 (W)  

 E-mail:nettama_at_charlie.cns.iit.edu,
        anettem_at_whittman-hart.com

Homepage: http://www.iit.edu/~nettama

****************************************************************************
Opinions are mine and do not necessarily reflect those of Whittman-hart
Inc.
Received on Mon Oct 13 1997 - 00:00:00 CEST

Original text of this message