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

Home -> Community -> Usenet -> c.d.o.server -> Re: Help (2nd request) with determining parent key foreign key relationship

Re: Help (2nd request) with determining parent key foreign key relationship

From: Stan Brown <stanb_at_panix.com>
Date: 9 Aug 2001 16:02:30 -0400
Message-ID: <9kuq8m$jai$1@panix1.panix.com>

In <9kuiob$rqa$1_at_panix1.panix.com> stanb_at_panix.com (Stan Brown) writes:

>In <8daca8eb.0108090930.6e6aa090_at_posting.google.com> j_p_x_at_hotmail.com (OK) writes:
 

>>1. My previous scripts list ALL FOREIGN KEY columns, not PK cols.
>OK, my misunderstanding.
 

>>2. It works no matter how many FKs a table has.
>Yes, I had figured that out, and amended my post.
 

>>3. I simplified a little bit, it gives out all the info for sys schema
>>in less than 1 sec.
>Much faster!
 

>>4. To list the PK cols, you only need to do slightly modification (see
>>below).
>>5. For DBA, I still think the 2nd one is much, much userful.
>Perhaps, but this is for use in a script to be run by non DBA's.
 

>>Here is the output:
 

>>Enter the table name check for foreign key: bonus
 

>>FK Column Name PK Table Name PK Column Name
>>-------------------- ------------------------- --------------------
>>DEPTNO DEPT DEPTNO
>>EMP_NAME, EMP_ID EMP ENAME, EMPNO
One more (small I hope) request. This script is to be used in a perl script, and I need to make the oputput a bit easier to parse.

For the multi column keys it reurns data like this:

XXXX YYYYY XXXX
AAA BBBB That is, the Pk Table name is not repeated. I _think_ this may be because of the "group by"s? In any case I have not been able to hack it suficently to get teh data in the format I need. I will also probably not be able to pass the coulmn fomrat specificatiosn to the DB, are they functionaly important? Or just to make it easier for humans to read? Received on Thu Aug 09 2001 - 15:02:30 CDT

Original text of this message

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