I have some 3 particular fields ..i want to know which all
tables have those 3 fields. Is there any way to identify..
can we know by quering system tables..

Answers were Sorted based on User's Feedback



I have some 3 particular fields ..i want to know which all tables have those 3 fields. Is there an..

Answer / srini

select * from sysibm.syscolumns where name = <name you 3
columns here>

The above query to metadata will show you the list of table
names where these 3 columsn present

Is This Answer Correct ?    6 Yes 0 No

I have some 3 particular fields ..i want to know which all tables have those 3 fields. Is there an..

Answer / dalwinder singh--intense tech

db2 "select name ,tbname ,typeschema,source_tabname from
sysibm.syscolumns where name='coloumn name'"

Is This Answer Correct ?    2 Yes 0 No

I have some 3 particular fields ..i want to know which all tables have those 3 fields. Is there an..

Answer / rajnish kumar

SELECT R.TABSCHEMA , R.TABNAME FROM
(select TABSCHEMA,TABNAME,COLNAME from syscat.columns where
COLNAME='ROLL') R
INNER JOIN
(select TABSCHEMA,TABNAME,COLNAME from syscat.columns where
COLNAME='NAME') N
ON R.TABNAME=N.TABNAME AND R.TABSCHEMA= N.TABSCHEMA

Is This Answer Correct ?    1 Yes 0 No

I have some 3 particular fields ..i want to know which all tables have those 3 fields. Is there an..

Answer / apoorv sharma

Learn SQL Trace for that... Tcode is ST05.

After this u will come to know which table contain those fields

Is This Answer Correct ?    0 Yes 0 No

I have some 3 particular fields ..i want to know which all tables have those 3 fields. Is there an..

Answer / ratheesh nellikkal

select name ,tbname ,typeschema,source_tabname from
sysibm.syscolumns where name='coloumn name'

This statement will work.
You can try this command also.

select tabname,colname
from syscat.columns
where COLNAME='ID'
and tabschema='MYSCHEMA'

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

What is the meaning of -805 SQL return code?

3 Answers  


Comment whether the cursor is closed during commit or not.

0 Answers  


What is bind in db2?

0 Answers  


How do I delete a table in db2?

0 Answers  


What is a Resource Control Table(RCT)? Describe its characteristics.

3 Answers  






What is table space in db2?

0 Answers  


What is runstats db2?

0 Answers  


In cursor program-1 can we create another cursor program-2 inside the cursor program-1.If yes how/no why ?

2 Answers   Wipro,


What is a buffer in memory?

0 Answers  


How can you display the current date & current time ?

7 Answers   Cap Gemini,


Explain the benefits you can get from mainframe connect?

0 Answers  


Name the various locking levels available?

0 Answers  


Categories