Re: Help! Script needed...
Date: 1996/12/12
Message-ID: <32b00931.5471628_at_internet.gpuc.com>#1/1
On 11 Dec 1996 08:10:27 GMT, N Prabhakar <prabhs_at_po.pacific.net.sg> wrote:
>duffy_at_cais.cais.com (MCC) wrote:
>>Hi Oracle Gurus,
>>
>> Does anyone have an working script that will list all the tables
>>that have the same column names? For a particular column name, I need
>>to know what tables have it. Instead of DESCRIB every tables in the
>>database, a working script will be highly appreciated.
>>
>>
>>Thanks,
>>Edith
>
Try the following and maybe even add an order by.
SELECT ALL SYS.USER_TAB_COLUMNS.TABLE_NAME,
USER_TAB_COLUMNS_A1.TABLE_NAME, SYS.USER_TAB_COLUMNS.COLUMN_NAME
FROM SYS.USER_TAB_COLUMNS,
SYS.USER_TAB_COLUMNS USER_TAB_COLUMNS_A1, SYS.USER_OBJECTS
WHERE SYS.USER_OBJECTS.OBJECT_TYPE='TABLE'
AND
((SYS.USER_TAB_COLUMNS.COLUMN_NAME=USER_TAB_COLUMNS_A1.COLUMN_NAME) AND (SYS.USER_TAB_COLUMNS.TABLE_NAME<>USER_TAB_COLUMNS_A1.TABLE_NAME) AND (USER_TAB_COLUMNS_A1.TABLE_NAME=SYS.USER_OBJECTS.OBJECT_NAME))
dmoyer_at_gpu.com Received on Thu Dec 12 1996 - 00:00:00 CET