RE: indexes of a table with jdbc
Posted in 2000
> Hi,
>
> I've to find out all the indexes of a table from a Java
> client. All the
> tables in a database I can get with a select statement "select * from
> sysmaster where dbsname="xx"". Is there any possibility to
> get the indexes in an easy way?
I don't know what platform your on but this definitely doesn't
work for me.
To find the indexes try
SELECT idxname
FROM sysindexes si, systables st
WHERE st.tabid = si.tabid
AND st.tabname = "sometable"
To get the tables
SELECT tabname
FROM systables
WHERE tabid > 99
Note that both of these selects need to be run against the database
that you are wanting to find the information about.
To get a list of databases try
SELECT name
FROM sysmaster:sysdbspartn
HTH
Jo
___________________________________________________________________________
This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
Sema Group.
If you are not the intended recipient, be advised that you have received this
email in error and that any use, dissemination, forwarding, printing, or
copying of this email is strictly prohibited.
If you have received this email in error please notify the Sema Group
Helpdesk by telephone on +44 (0) 121 627 5600.
___________________________________________________________________________