View previous topic :: View next topic
|
Author |
Message |
Ashok09
New User
Joined: 29 Mar 2009 Posts: 20 Location: Chennai
|
|
|
|
Hi,
Quest1: Consider i have column CITY, but i dont know in which all tables the CITY column available. what is the sql query to retrieve the list of tables for a particular column.
Quest2: how to view the index which are created already?
Let me know, if quest are not clear enough
Thanks in Advance!! |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Q1 : SYSIBM.SYSCOLUMNS
Q2 : not clear |
|
Back to top |
|
|
deepthimadhu
New User
Joined: 03 Mar 2009 Posts: 12 Location: Trivandrum
|
|
|
|
You can try this for question no: 1
SELECT *
FROM SYSIBM.SYSCOLUMNS
WHERE NAME = 'CITY'; |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Q2 : SYSIBM.SYSINDEXES table |
|
Back to top |
|
|
Ashok09
New User
Joined: 29 Mar 2009 Posts: 20 Location: Chennai
|
|
|
|
@deepthimadhu
Quote: |
SELECT *
FROM SYSIBM.SYSCOLUMNS
WHERE NAME = 'CITY' |
The above query list only the columns available in all table, but my question is "to retrieve the list of tables for a particular column". so the query output should be the table names.
Quest 2:
I want to view the content of a particular index. Is tat possible?
SYSIBM.SYSINDEXES wil list the index which are created.
Thank you. |
|
Back to top |
|
|
deepthimadhu
New User
Joined: 03 Mar 2009 Posts: 12 Location: Trivandrum
|
|
|
|
[The above query list only the columns available in all table, but my question is "to retrieve the list of tables for a particular column". so the query output should be the table names. ]
Please try running the query before replying...The WHERE clause contains the particular column name 'CITY'. The query o/p would contain the table names along with many other information for the column 'CITY'.
[/quote] |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
The above query list only the columns available in all table, but my question is "to retrieve the list of tables for a particular column". so the query output should be the table names. |
No, you are wrong.
If you don't want all the columns for each row that represents tables (qualified by creator) containing a column 'CITY', modify the SELECT * to SELECT TBNAME.
SYSCOLUMNS |
|
Back to top |
|
|
Ashok09
New User
Joined: 29 Mar 2009 Posts: 20 Location: Chennai
|
|
|
|
yes i got answer for quest1.
what is the query for
Quest 2:
I want to view the content of a particular index |
|
Back to top |
|
|
Ashok09
New User
Joined: 29 Mar 2009 Posts: 20 Location: Chennai
|
|
|
|
frnds got solution for Quest 2 as well.
Thank you.... |
|
Back to top |
|
|
raja.j
New User
Joined: 10 Dec 2009 Posts: 1 Location: Bangalore
|
|
|
|
Q1. select * fom sysibm.syscolums.
Q2. Select * from sysibm.sysindex. |
|
Back to top |
|
|
rexx77
New User
Joined: 14 Apr 2008 Posts: 78 Location: Mysore
|
|
|
|
Quote: |
Q1. select * fom sysibm.syscolums.
Q2. Select * from sysibm.sysindex
|
I greatly appreciate for your effort to answer the question, but did you check the tables you have mentioned before submitting the answer.
it is SYSCOLUMNS, SYSINDEXES respectively. |
|
Back to top |
|
|
|