Page 1 of 1

doubt in SYSIBM.SYSTABLESTATS.

PostPosted: Wed Jun 01, 2011 9:05 pm
by Viswanathchandru
Hi folks,
When i ran this query
SELECT * FROM SYSIBM.TABLESPACESTATS;
I didnt get anything what i needed. Instead it gave me sqlcode -204. what could be the reason for this. In our shop we are using DB2 8.1. I went through the manual and it says my query was the correct one. can anyone guide me on this please. Apologies if i'm wrong.

Thanks,
Viswa

Re: doubt in SYSIBM.SYSTABLESTATS.

PostPosted: Wed Jun 01, 2011 9:44 pm
by Akatsukami
The table name should be SYSTABLESPACESTATS, as you would have known if you had read the message associated with SQLCODE -204.

Re: doubt in SYSIBM.SYSTABLESTATS.

PostPosted: Wed Jun 01, 2011 9:49 pm
by Viswanathchandru
Hi akatsukami,
Thanks a lot for your time and reply. The same is the response for the SYSIBM.SYSTABLESPACESTATS. And the reason why i did as SYSIBM.TABLESPACESTATS is that in our shop we have DB2 8.1. here is the response after your advice.
---------+---------+---------+---------+---------+---------+---------+---------+
DSNT408I SQLCODE = -204, ERROR: SYSIBM.SYSTABLESPACESTATS IS AN UNDEFINED NAME
DSNT418I SQLSTATE = 42704 SQLSTATE RETURN CODE
could you please guide me on this. Apologies if i'm wrong.


Thanks,
Viswa

Re: doubt in SYSIBM.SYSTABLESTATS.

PostPosted: Wed Jun 01, 2011 11:26 pm
by enrico-sorichetti
would it be so difficult to look at the manuals Yourself to find out the proper name ? :evil:
as per ... ( db2 v9 ) up to you to find the same for Your DB2 version
http://publibz.boulder.ibm.com/cgi-bin/ ... 1120084907

but a SELECT * FROM SYSIBM.SYSTABLES should give a quick and dirty hint on how to proceed

Re: doubt in SYSIBM.SYSTABLESTATS.

PostPosted: Thu Jun 02, 2011 12:52 am
by dick scherrer
Hello,

SELECT * FROM SYSIBM.TABLESPACESTATS;
Why was this query even run? How was the name of the "table" determined?

It is usually best to do a bit of research before submitting a query using unknown objects. . .

Re: doubt in SYSIBM.SYSTABLESTATS.

PostPosted: Mon Jun 06, 2011 11:54 am
by GuyC
SYSIBM.SYSTABLESPACESTATS used to be called SYSIBM.TABLESPACESTATS when it was first introduced.
The possible reason why neither exists, is that the existence of this table was not obligatory and it had to be set up by the DBA.
In DB2 v9 they renamed it and made the tables part of the catalog.

but indeed a simple select * from systables where creator = 'SYSIBM' would have resolved this matter easily