IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to search for a colum name in DB2?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
softwareengineer

New User


Joined: 24 Aug 2005
Posts: 24
Location: Hyderabad

PostPosted: Thu Jul 12, 2007 2:44 pm
Reply with quote

Suppose if i want to modify a column name and dont know how many tables have that column included. How can I search/find the column in all tables exist in DB2? using anything like SPUFI, SQL statements, etc...

Thanks in advance..
Back to top
View user's profile Send private message
Karthikshankar

New User


Joined: 29 Jun 2007
Posts: 2
Location: Pune

PostPosted: Thu Jul 12, 2007 3:43 pm
Reply with quote

The Dictionary tables can be queried to get information about any columns. There are lots of dictionary tables like, SYSIBM.SYSTABLES, SYSIBM.SYSVIEWS, SYSIBM.SYSOBJECTS, SYSIBM.SYSPLANS etc. The Dictionary table SYSIBM.SYSCOLUMNS would contain all the column information (column type, it's integrity constraints etc).

A simple select Statement in SPUFI or QMF would help in retrieving this information.

A Sample SQL:

SELECT <DD-COLUMN1>,<DD-COLUMN2> FROM
SYSIBM.SYSCOLUMNS WHERE NAME = <COLUMN-NAME>

Note: Issuing a 'SELECT * FROM SYSIBM.SYSCOLUMNS' would display
lot of rows through which one can first check no. of columns the data
dictionary table has and accordingly issue the desired query.
Back to top
View user's profile Send private message
Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Fri Aug 03, 2007 9:40 am
Reply with quote

The suggestion above will work. I would also like to suggest
if your system use DCLGEN libraries you can use ISPF 3.14 to
search for the particular column name in the PDS containing
the DCLGEN libraries. If you don't maintain DCLGEN libraries
then you can try the approach above.


Regards.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts first column truncated in search result IBM Tools 13
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top