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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: query help

RE: query help

From: Vipul Mukund Shah <vipul.shah_at_almarai.com>
Date: Fri, 12 May 2000 12:17:12 +0300
Message-Id: <10495.105460@fatcity.com>


This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible.

------_=_NextPart_001_01BFBBF2.DEF111B0

Content-Type: text/plain

Try these query

SELECT a.constraint_name, b.pt, b.pc, a.ct, a.cc FROM (

       SELECT constraint_name, table_name ct, column_name cc
       FROM   user_cons_columns
       WHERE  constraint_name IN(SELECT constraint_name
                                 FROM   user_constraints
                                 WHERE  constraint_type like 'R'))a,
      (
       SELECT constraint_name, table_name pt, column_name pc
       FROM   user_cons_columns
       WHERE  constraint_name IN (SELECT r_constraint_name
                                  FROM   user_constraints
                                  WHERE  constraint_type like 'R'))b
Regards,
VMS
	-----Original Message-----
	From:	gfaktor_at_ecal.com [SMTP:gfaktor_at_ecal.com]
	Sent:	Thursday, May 11, 2000 9:29 AM
	To:	Multiple recipients of list ORACLE-L
	Subject:	query help

	Hi All!
	I need write query to receive following info from data dictionary:
	
----------------------------------------------------------------------------
	--------------
	Constaraint_Name   | Parent_Table  |   Parent_Column	|
Child_Table	|
	Child_Column
	
----------------------------------------------------------------------------
	--------------

	for all foreign keys.

	Thanks.
	Greg.

	-- 
	Author: Gregory Faktor
	  INET: gfaktor_at_ecal.com

	Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
	San Diego, California        -- Public Internet access / Mailing
Lists
	--------------------------------------------------------------------
	To REMOVE yourself from this mailing list, send an E-Mail message
	to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
	the message BODY, include a line containing: UNSUB ORACLE-L
	(or the name of mailing list you want to be removed from).  You may
	also send the HELP command for other information (like subscribing).

------_=_NextPart_001_01BFBBF2.DEF111B0

Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 5.5.2650.12">
<TITLE>RE: query help</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">Try these query</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">SELECT a.constraint_name, b.pt, b.pc, = a.ct, a.cc</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">FROM (</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = SELECT constraint_name, table_name ct, column_name cc</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = FROM&nbsp;&nbsp; user_cons_columns</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = WHERE&nbsp; constraint_name IN(SELECT constraint_name</FONT> <BR><FONT SIZE=3D2 =

FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
FROM&nbsp;&nbsp; user_constraints</FONT> <BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
WHERE&nbsp; constraint_type like 'R'))a,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = SELECT constraint_name, table_name pt, column_name pc</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = FROM&nbsp;&nbsp; user_cons_columns</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = WHERE&nbsp; constraint_name IN (SELECT r_constraint_name</FONT> <BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
FROM&nbsp;&nbsp; user_constraints</FONT> <BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
WHERE&nbsp; constraint_type like 'R'))b</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Regards,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">VMS</FONT>
</P>
<UL>
<P><A NAME=3D"_MailData"><FONT SIZE=3D2 FACE=3D"Arial">-----Original =
Message-----</FONT></A>
<BR><B><FONT SIZE=3D2 FACE=3D"Arial">From:&nbsp;&nbsp; gfaktor_at_ecal.com = [SMTP:gfaktor_at_ecal.com]</FONT></B>
<BR><B><FONT SIZE=3D2 FACE=3D"Arial">Sent:&nbsp;&nbsp;</FONT></B> <FONT = SIZE=3D2 FACE=3D"Arial">Thursday, May 11, 2000 9:29 AM</FONT> <BR><B><FONT SIZE=3D2 =
FACE=3D"Arial">To:&nbsp;&nbsp;&nbsp;&nbsp;</FONT></B> <FONT SIZE=3D2 = FACE=3D"Arial">Multiple recipients of list ORACLE-L</FONT> <BR><B><FONT SIZE=3D2 =
FACE=3D"Arial">Subject:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT>= </B> <FONT SIZE=3D2 FACE=3D"Arial">query help</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi All!</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">I need write query to receive = following info from data dictionary:</FONT> <BR><FONT SIZE=3D2 =

FACE=3D"Arial">---------------------------------------------------------=
-------------------</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">--------------</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">Constaraint_Name&nbsp;&nbsp; | = Parent_Table&nbsp; |&nbsp;&nbsp; Parent_Column&nbsp;&nbsp;&nbsp; = |&nbsp;&nbsp; Child_Table |</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Child_Column</FONT> <BR><FONT SIZE=3D2 =
FACE=3D"Arial">---------------------------------------------------------=
-------------------</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">--------------</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">for all foreign keys.</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Greg.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">-- </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Author: Gregory Faktor</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; INET: gfaktor_at_ecal.com</FONT> </P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Fat City Network = Services&nbsp;&nbsp;&nbsp; -- (858) 538-5051&nbsp; FAX: (858) = 538-5051</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">San Diego, = California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet = access / Mailing Lists</FONT>
<BR><FONT SIZE=3D2 =

FACE=3D"Arial">---------------------------------------------------------=
-----------</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">To REMOVE yourself from this mailing = list, send an E-Mail message</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">to: ListGuru_at_fatcity.com (note EXACT = spelling of 'ListGuru') and in</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">the message BODY, include a line = containing: UNSUB ORACLE-L</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">(or the name of mailing list you want = to be removed from).&nbsp; You may</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">also send the HELP command for other = Received on Fri May 12 2000 - 04:17:12 CDT

Original text of this message

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