MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQL for Db2 Z.OS / Version 8.1/

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
zefrim
Beginner


Joined: 29 Jun 2006
Posts: 22
Topics: 19

PostPosted: Mon Aug 21, 2006 8:25 am    Post subject: SQL for Db2 Z.OS / Version 8.1/ Reply with quote

Hi all,

perhaps somebody can help me:

i want to show all tables with the sum of the indices per table
and those all in one SQL-Stmt.

Example:


" SELECT creator,name ,"sum(ix)" from sysibm.systables where creator like 'SAPR3%"

RESULT:

creator NAME SUM-INCODES

SAPR3 ATAB 02
SAPR3 DLIB01 13
SAPR3 TECHNX 0
.
.
.

How looks this SQL-Stmt ?

Thanks

Zefrim
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Aug 21, 2006 10:17 am    Post subject: Reply with quote

zefrim,

The information you are looking is available in sysibm.sysindexes DB2 catalog table.

try this sql

Code:

SELECT CREATOR                 
      ,TBNAME                   
      ,COUNT(INDEXSPACE)       
  FROM SYSIBM.SYSINDEXES       
 GROUP BY CREATOR,TBNAME         


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
zefrim
Beginner


Joined: 29 Jun 2006
Posts: 22
Topics: 19

PostPosted: Wed Aug 23, 2006 1:53 am    Post subject: Reply with quote

thanks it works
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group