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 db2 command?

0 Answers  


Is schema the same as database?

0 Answers  


Is db2 relational database?

0 Answers  


how to copy the host variables from ps file into cobol program other than include statement

1 Answers   Syntel,


How does cobol compile db2 program?

0 Answers  


How to resolve -917 sql code in DB2?

3 Answers   Cap Gemini,


wht happens if we close cursor with cursor with hold option?

3 Answers   Valtech,


how can you copy records present in a flat physical file to a database file(physical file).please explain in rpg400 with a simple example

1 Answers   CTS,


How do I handle -911 (deadlock) error in a db2 program so that the program will never abend?

3 Answers   CTS, IBM,


what is utility for parm lib

0 Answers   IBM,


What are the disadvantages of PAGE level lock?

3 Answers  


What is pagespace?

1 Answers  


Categories