Re: Three-Way table join

From: Vikram Goel <vgoel_at_pts.mot.com>
Date: 1996/01/16
Message-ID: <4dgl7b$52a_at_lserv1.paging.mot.com>#1/1


Parris,

Try this:

select a.table_name,
       a.column_name,
       a.data_type,
       a.data_length,
       c.constraint_name,
       DECODE(c.constraint_type,'P','Primary Key','R','Refrential','C','Check','U','Unique key','V','View Cons',c.constraint_type) 
         Cons_type
from user_tab_columns a,
     user_cons_columns b,
     all_constraints c
where a.table_name = c.table_name

and c.constraint_name = b.constraint_name and a.column_name = b.column_name
order by a.table_name,c.constraint_type;

Vikram Goel

Sr. Consultant DBA

Aerotek Inc, Florida.


In article <4desmi$e5o_at_athos.cc.bellcore.com>, parris_at_walleye.esp.bellcore.com (Parris Geiser) writes:
>Hi,
> I would like to produce a report from the tables:
> user_tab_columns
> all_constraints
> user_cons_columns
> that looks like the following:
>TABLE_NAME COLUMN_NAME DATA_TYPE DATA_LENGTH CONSTRAINT_NAME CONSTRAINT_TYPE
>
>Does anyone know how to do a join to produce this?
> Thanks,
> parris


Vikram Goel                            Phone   : (407) 739-8388
Motorola                                               739-8338
1500 gateway Blvd                      Email   : vgoel_at_cim.pts.mot.com
Boynton Beach                          Pager   : 4894
Fl, 33426
Received on Tue Jan 16 1996 - 00:00:00 CET

Original text of this message