doubt in SYSIBM.SYSTABLESTATS.



IBM's flagship relational database management system

doubt in SYSIBM.SYSTABLESTATS.

Postby Viswanathchandru » Wed Jun 01, 2011 9:05 pm

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: doubt in SYSIBM.SYSTABLESTATS.

Postby Akatsukami » Wed Jun 01, 2011 9:44 pm

The table name should be SYSTABLESPACESTATS, as you would have known if you had read the message associated with SQLCODE -204.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: doubt in SYSIBM.SYSTABLESTATS.

Postby Viswanathchandru » Wed Jun 01, 2011 9:49 pm

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
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: doubt in SYSIBM.SYSTABLESTATS.

Postby enrico-sorichetti » Wed Jun 01, 2011 11:26 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: doubt in SYSIBM.SYSTABLESTATS.

Postby dick scherrer » Thu Jun 02, 2011 12:52 am

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. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: doubt in SYSIBM.SYSTABLESTATS.

Postby GuyC » Mon Jun 06, 2011 11:54 am

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
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post