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 

How to Fetch a row only if the table contains more than 100?

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


Joined: 29 May 2004
Posts: 16
Topics: 4
Location: chennai

PostPosted: Sun Aug 06, 2006 7:41 pm    Post subject: How to Fetch a row only if the table contains more than 100? Reply with quote

The requirement is to fetch a row in a table only if the table contains more than 100 rows.
Note : The Query should not be tried with the Count operator
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Sun Aug 06, 2006 7:56 pm    Post subject: Reply with quote

Quote:

Note : The Query should not be tried with the Count operator

karthikeyan,

Who came up with such a *Brilliant* idea ? Evil or Very Mad

Is this a real requirement ?

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


Joined: 29 May 2004
Posts: 16
Topics: 4
Location: chennai

PostPosted: Mon Aug 07, 2006 12:28 am    Post subject: Reply with quote

Kolusu

Is there a possibility to do it with a Row ID ?

Karthik
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Mon Aug 07, 2006 4:57 pm    Post subject: Reply with quote

Row ID is an internal format, not related to row number.
If you don't want to use COUNT function, try this
1. run RUNSTATS utility on this tablespace
2. get the value of CARDF from catalog table SYSIBM.SYSTABLES, it's the number of rows when the unitily run.
3. fetch or not depend on the value....
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