IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Gettig error in fetching the no of rows in SQL


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
janardhana Reddy

New User


Joined: 20 Oct 2004
Posts: 17
Location: Bangalore

PostPosted: Thu Oct 21, 2004 1:18 pm
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
unna

New User


Joined: 15 Oct 2004
Posts: 17

PostPosted: Thu Oct 21, 2004 6:35 pm
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
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: 1592

PostPosted: Tue Oct 26, 2004 1:54 am
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
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
Search our Forums:

Back to Top