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: How to know to what table a field belongs?

Re: How to know to what table a field belongs?

From: DA Morgan <damorgan_at_x.washington.edu>
Date: Tue, 19 Oct 2004 23:26:07 -0700
Message-ID: <1098253516.107971@yasure>


md9_at_ibest.com.br wrote:

> Hi,
>
> I´m fixing a system made by another programmer,this system is very
> large and have no documentation at all.
>
> I want a command like this:
>
> select TABLE_NAME from USER_TABLES WHERE FIELD_NAME='PROJ_ID'
>
> Regards,
> Marcello Dias

My gut feeling is you are in no position to be fixing any system, much less a large one, if you don't know the answer. You need to learn your data dictionary.

So lesson #1.

SQL> desc user_tab_columns
SQL> desc user_ind_columns
SQL> desc user_cons_columns
SQL> desc user_clu_columns
SQL> desc dict_columns
SQL> desc dba_updatable_columns

And here's the SQL statement so you can find the rest of them:

SELECT UNIQUE view_name
FROM dba_views
WHERE view_name LIKE '%COLUMNS'
ORDER BY 1;

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Wed Oct 20 2004 - 01:26:07 CDT

Original text of this message

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