Re: How do I view the key contraints on Oracle7??
Date: 1995/05/16
Message-ID: <3p9924$m2r_at_news.tamu.edu>#1/1
In article <3p83n1$mon_at_news.tamu.edu>,
Mahesh Vallampati <m0v5533_at_tam2000.tamu.edu> wrote:
>In article <Roberts_Daniel_g.PRILVMS3-1505951146430001_at_riversend.bms.com>,
>Dan Roberts <Roberts_Daniel_g.PRILVMS3_at_msmail.bms.com> wrote:
>>key constriants..how do I view them to make sure I did it correctly??
>>The describe table command jsut shows me attribute names and such
>>and I just can't figure out how to view the key constraints.>thnaks for your
>>hgelp.>>dan
>>Dan Roberts
>>PRINCETON, NEW JERSEY U.S.A. PLANET EARTH, MILKY-WAY GALAXY
>><<<<INTERNET ADDRESS>>>>Roberts_Daniel_G.PriLVMS3_at_MSMAIL.BMS.COM
>
>The system user who is the dba has a table called dba_constraints. This
Here is a somewhat better script to do the above.
select constraint_name,
decode(constraint_type,'C','Check Constraint on a table',
'P','Primary Key', 'U','Unque_Key', 'R','Referential Integrity', 'V','Check Option on a View') Constraint,search_condition,
substr(delete_rule,1,10) delete_rule,
substr(status,1,10) from
dba_constraints where table_name=&ur_table_name;
The previous posting contained sql code which produced output which was
cryptic. The above script makes it more clear in terms of its output.
I am wondering if anyone had a script which could reverse engineer a
sqlplus table creation script from the data dictionary or the system/sys
tables. Is it possible to do that?
Thanks
Mahesh Vallampati
Home: Office: PH : 409 846 3794 (H) | 409 862 1070 (O) e-mail address : vallampa_at_ee.tamu.edu WWW : http://tam2000.tamu.edu/~m0v5533/ Lab : 409 847 8609Received on Tue May 16 1995 - 00:00:00 CEST