Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find a table(s)/view(s) given a column 1

Status
Not open for further replies.

Nilgiri

MIS
Jan 7, 2003
4
AU


How in Teradata do I find all tables and/or views which contain a specific column (name)? (A common technique to ensure that you understand foreign-key realtionships (assuming architects have been consistent with naming standards across tables.views)).



I know in DB2 that you can use the DB2 system catalogue table SYSCOLUMNS to do this... I am unaware if Teradata has equivalent catalogue tables.

I can see that Queryman has an option to list tables and views; and columns for a specified table or view; but not table/view(s) for a given column.
 
In Teradata, there are equivalent tables, try Teradata's COLUMNS for DB2's SYSCOLUMNS; and TABLES for SYSTABLES; etc.

So, to find all tables (or views) containing a given column -

select distict databasename, tablename from dbc.columns where columnname = 'fred';

Roger...
 


Thanks for the tip, Roger - works a treat!

What and where is the Teradata document that explains the catalog tables?
 
"What and where is the Teradata document that explains the catalog tables?"

It's the Data Dictionary Manual

Dieter
 
Dieter,

Thanks for the info.

For all those Teradata newbie's like myself; I found the Data Dictionary documentation on the NCR website (along with other much treasured publications on Teradata).

Refer (1st link under the 'Titles' heading, named 'Data Dictionary').

Regards!
 
Nilgiri, just order the V2R5 demo, it includes the full documentation...

Dieter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top