473,800 Members | 2,659 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to query the DB2 z/OS V7 dictionary for indexes?

Hi, i've tried to query the dictionary for indexes on a table as
follows:

SELECT KEYS.COLNAME, KEYS.COLNO, KEYS.COLSEQ, KEYS.ORDERING
FROM SYSIBM.SYSKEYS KEYS, SYSIBM.SYSINDEX ES IDXS
WHERE IDXS.NAME = KEYS.IXNAME
AND IDXS.CREATOR = KEYS.IXCREATOR
AND IDXS.TBNAME = 'FOOBAZ'
AND IDXS.TBCREATOR = 'FOOBAR'
;

Looks like i missed something because this gives me lots of doubled
lines. Any hints?

TIA, Markus

Jan 12 '06 #1
1 2127
Markus Neifer wrote:
Hi, i've tried to query the dictionary for indexes on a table as
follows:

SELECT KEYS.COLNAME, KEYS.COLNO, KEYS.COLSEQ, KEYS.ORDERING
FROM SYSIBM.SYSKEYS KEYS, SYSIBM.SYSINDEX ES IDXS
WHERE IDXS.NAME = KEYS.IXNAME
AND IDXS.CREATOR = KEYS.IXCREATOR
AND IDXS.TBNAME = 'FOOBAZ'
AND IDXS.TBCREATOR = 'FOOBAR'
;

Looks like i missed something because this gives me lots of doubled
lines. Any hints?

TIA, Markus


Hi!

I'm not so familiar with SYSKEYS, but I think this is because some keys
are used in several indexes in the same TBNAME / TBCREATOR aren't them?
This is how I tried it:
SELECT KEYS.COLNAME
, KEYS.COLNO
, KEYS.COLSEQ
, KEYS.ORDERING
, IDXS.TBNAME
, IDXS.TBCREATOR
, KEYS.*
, IDXS.*

FROM SYSIBM.SYSKEYS KEYS
, SYSIBM.SYSINDEX ES IDXS

WHERE IDXS.NAME = KEYS.IXNAME
AND IDXS.CREATOR = KEYS.IXCREATOR
AND IDXS.TBNAME = 'FOOBAZ'
AND IDXS.TBCREATOR = 'FOOBAR'

ORDER BY KEYS.COLNAME
, KEYS.COLNO
, KEYS.COLSEQ
, KEYS.ORDERING
, IDXS.TBNAME
, IDXS.TBCREATOR
;

Jan 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1542
by: San71 | last post by:
I'm writing an application which creates a rather large dictionary (> 500 MB) from MySQL data. It is a dictionary which uses integers, tuples, and datetime instances as keys. I've tried shelve (str() en eval() for the integer and tuples), but of course, that doesn't solve it, because I also need to keep the datetime instances intact as a key. Is there a way to make this dictionary persistent?
3
1803
by: Jack A | last post by:
OK Guys. I'm fed up of the query below taking too much time. I CANT change the query since it is generated by a 3rd party product. I can change indexes and add new indexes though. The schema of the tables is given below. The most expensive operation is a bookmark lookup on VGNCCB_ROLE_JT. I created the speed_up_login index as a covering index to cover the query but that has not seemed to help. Any ideas, suggestions are most welcome...
6
1935
by: Steven D.Arnold | last post by:
I have a query which does not use column indexes that it should use. I have discovered some interesting behaviors of Postgres which may indicate a bug in the database's query planning. Take a look at the query below. There is a btree index on both m.account_id and a.account_id. Query (1) does not use the index on the messages table, instead opting for a full table scan, thus killing performance. The messages table can contain...
11
4098
beacon
by: beacon | last post by:
Hi everybody, I created a database that links one table from an ODBC data source. I saved my password and UID to the data source so neither myself nor anyone else would have to login each time (that's just bonus background info). I take this table, which is read-only, and run an APPEND query that adds new items from the table into another table I created (that has two additional fields that will be updated by the user via a form). I also...
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10279
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10255
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2948
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.