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 

Select Count(*)

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


Joined: 28 May 2003
Posts: 51
Topics: 30

PostPosted: Thu Dec 04, 2003 12:11 pm    Post subject: Select Count(*) Reply with quote

Hi,

This is something inique problem. We did a database migration ,
the steps used were, DDLs generation, then getting all the DBIDs, OBIDs and all and then then generated DSN1COPY, after which Rebuild index was run.

All went through fine,
But if we make a SELECT (*) on that table we get 0 rows, but if we make SELECT * then all the data is dispalyed, have tried everyhting, running runstats, unloading and loading data. but still the row count is the same.

Any suggestions!!!!!
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: Thu Dec 04, 2003 1:38 pm    Post subject: Reply with quote

Vani,

How is the SELECT COUNT(*) being execueted? Is it via SPUFI/QMF or a program? If it is spufi or qmf make sure that you are pointing to the right DB2 region. you can check if there are any tables existing with the same name.

Code:

 SELECT *
   FROM SYSIBM.SYSTABLES
  WHERE NAME = 'TABLE NAME'


Now you will get all the tables/views with the same name.Alternatively did you run your query with DSNSTEP2?

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
vani
Beginner


Joined: 28 May 2003
Posts: 51
Topics: 30

PostPosted: Thu Dec 04, 2003 10:57 pm    Post subject: Reply with quote

I am executing it to batch Spufi using DSNTEP2 only, and the DB2 region name is the same. i have cross checked it.
Back to top
View user's profile Send private message
SureshKumar
Intermediate


Joined: 23 Jan 2003
Posts: 211
Topics: 21

PostPosted: Fri Dec 05, 2003 8:37 am    Post subject: Reply with quote

Vani, Are you using SELECT COUNT (*) or just SELECT (*) , just in case its a syntax issue..
Back to top
View user's profile Send private message
Shaik Salauddin
Beginner


Joined: 16 Dec 2003
Posts: 3
Topics: 0

PostPosted: Fri Dec 19, 2003 8:55 am    Post subject: Reply with quote

Can you please check the value for the column name as CARD in SYSIBM.SYSTABLES and SYSINDEXPART for the table name. If the runstats have run fine it would have updated with proper statistics. Otherwise it will have -1 in them. This is just to confirm whether the statistics have updated properly or not. But irrespective of the value in the card, if we use a count(*) it will result the number of rows.
Hope this may be of littile help...
Thanks,
Shaik
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