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

Suppose I have a program which uses a dynamic SQL and it has been performing well till now. Off late, I find that the performance has deteriorated. What happened?

1 Answers  


What is the use of COMMAREA ?Minimum how much data we can pass from it?

7 Answers   Cap Gemini,


in my table i will update only 100 record among 1000 records i need to display recently updated record'.....can u tell me where those records are stored how can i display those records...?if there is any sql query pls let me know....?

3 Answers   Infosys,


Why do chiropractors use drop table?

0 Answers  


What is a cursor and what is its function?

2 Answers  






What is ibm db2 connect?

0 Answers  


What is ibm db2 client?

0 Answers  


Return code 100 means?

6 Answers   Cap Gemini,


why db2 is called as universal database?what is the storage capacity of db2v9 n what are the advantages of db2

3 Answers  


What is ALTER ?

3 Answers  


What is a db2 package?

0 Answers  


What is CHECK PENDING ?

5 Answers  


Categories