Do we need cursor for Count(*)?

Answers were Sorted based on User's Feedback



Do we need cursor for Count(*)?..

Answer / nak

No,Count(*) will give u the number of record in a table.

Ex: select Count(*) from EMP table where EMPNAME='sunil'

Is This Answer Correct ?    13 Yes 1 No

Do we need cursor for Count(*)?..

Answer / yaswanth

we will use cursors when we have situation like the query
returning multiple rows but in this case
select Count(*) from EMP table where EMPNAME='some' will
return only one row, i.e how many rows it found with
EMPNAME='some' eg:3 or 4 or 5 ... so there is no concept of
cursor here

Is This Answer Correct ?    9 Yes 3 No

Do we need cursor for Count(*)?..

Answer / shravan kumar.p

no need..
select count(*) from the emp.
it will give the total no of rows in a table..

Is This Answer Correct ?    2 Yes 0 No

Do we need cursor for Count(*)?..

Answer / sachin borase

select 8 from table fetch first 3 rows only

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More DB2 Interview Questions

in GDG: is it poosible to copy records from a file which utilizes some 100 cylinders to a gdg whose model is defined as trk(1,0) and also it possible to copy 100 bytes file to 80 bytes file?

1 Answers   IBM,


Define db2.

0 Answers  


If the main program has only cobol statements and subprogram has the db2 statements what is the procedure for precompilation. for which program we need to do the precompilation

1 Answers   IBM,


Q1. How will you use two different DB2 qualifiers in a single COBOL program? Suppose we have 2 tables EMP1 and EMP2 with same structure defined in two different DB2 qualifiers QUAL1.EMP1 and QUAL2.EMP2 now during first 15 days we want to use QUAL1.EMP1 and rest of the days QUAL2.EMP2  how will we do this.  We can create a single program and a single load for this program. 

2 Answers   RBS,


How many databases are there?

0 Answers  






List out the data types available.

0 Answers  


How to resolve the -305 error code in DB2? And also please let me know, how to resolve the db2 error codes.

7 Answers   TCS,


What is view db2?

0 Answers  


Mention data types used in db2 ?

0 Answers  


wht is d/f b/w inner join and outer join ? d/f group by and order by having by ?

2 Answers  


How to execute stored procedures?

0 Answers  


Define buffer pool.

0 Answers  


Categories