how get view from a field name

Database

how get view from a field name

Hi,

This is my first post.. so do let me know if I am violating any forum rules.
I am using Teradata SQL Assistant 7.1
I have connected to data warehouse, where i can see only views.
my problem is I have a field name called "mech.offer.id" but i dont know in which view it exists.
how do i find this.

thanks for your help.
Arvind
1 REPLY
Enthusiast

Re: how get view from a field name

Try any of these query with the correct Column Name...

SELECT
T.DatabaseName,
T.TableName
FROM DBC.Columns C,
DBC.Tables T
WHERE C.TableName=T.TableName
AND C.DataBaseName=T.DataBaseName
AND T.TableKind = 'V'
AND C.ColumnName = 'ColumnNameToSearch';

OR

SELECT
D.DataBaseName,
M.TVMNAME
FROM DBC.TVM M,
DBC.TVFields F,
DBC.DBase D
WHERE M.TVMID=F.TableId
AND M.DataBaseId=F.DataBaseID
AND F.DataBaseID = D.DataBaseID
AND M.TableKind='V'
AND F.FieldName='ColumnNameToSearch';