Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Gettig error in fetching the no of rows in SQL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
janardhana Reddy

New User


Joined: 20 Oct 2004
Posts: 17
Location: Bangalore

PostPosted: Thu Oct 21, 2004 1:18 pm    Post subject: Gettig error in fetching the no of rows in SQL
Reply with quote

Hi all

I am getting the result for for the following query.
Select * from table_name;

now gettig the error in fetching the no. of rows from the below query.

select count(*) from table_name;


What does it mean ?
Back to top
View user's profile Send private message
References
PostPosted: Thu Oct 21, 2004 1:18 pm    Post subject: Re: Gettig error in fetching the no of rows in SQL Reply with quote

unna

New User


Joined: 15 Oct 2004
Posts: 18

PostPosted: Thu Oct 21, 2004 6:35 pm    Post subject:
Reply with quote

Hi Jana,

count * in the select statement will display the number of rows in a tableand will not fetch the rows from the table.

Regards,
Back to top
View user's profile Send private message
janardhana Reddy

New User


Joined: 20 Oct 2004
Posts: 17
Location: Bangalore

PostPosted: Mon Oct 25, 2004 10:33 am    Post subject:
Reply with quote

Hi Unna,

not getting the result for the query select count(*) from table name
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1493

PostPosted: Tue Oct 26, 2004 1:54 am    Post subject:
Reply with quote

Hi Janardhana,

Try this:

select count(*) as rcdcnt from table_name;
Back to top
View user's profile Send private message
janardhana Reddy

New User


Joined: 20 Oct 2004
Posts: 17
Location: Bangalore

PostPosted: Tue Oct 26, 2004 11:08 am    Post subject:
Reply with quote

Hi all,

My query is Select count(*) from se_number;

and not getting result for the above query.

Getting the rows for Select * from Se_number;


Finally i got the reason , no index exists for that table.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1