Select empno, sal from emptbl where empno < 101.By this
query can we fetch first 100 recs? where empno is primary
key.It won't throw -811 error? if it wont,then what is use
of cursor technique while fetching first 100 recs.


Please need more clarification.

Answers were Sorted based on User's Feedback



Select empno, sal from emptbl where empno < 101.By this query can we fetch first 100 recs? wh..

Answer / kingmanish

Yes this query will fetch multiple records.

If tried to fetch these records in variables in a sql query
it will give -811 error.

In order to be able to handle these multiple records we
have to use cursor.

Now using cursor we can process each of these records one
at a time and thus cursors come handu here.

Is This Answer Correct ?    6 Yes 0 No

Select empno, sal from emptbl where empno < 101.By this query can we fetch first 100 recs? wh..

Answer / madhu t

If the to fetch empno and sal from emptble is written in
embedded sql then it will give sqlcode -811.
yes this query fetches first 100 records of employee table.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More DB2 Interview Questions

Discuss about db2 bind?

0 Answers  


What is the physical storage length of time data type?

0 Answers  


in my project..TEST is db2 8.1 version In PROD it is 7.1 if i do REORG in TEST.. can I use the same REORG jcl with out modification in PROD region (this is DB2 8.1 )? if not, what modification i need to do in my REORG control card?

0 Answers  


What is with ur in db2?

0 Answers  


What is dbrm?

0 Answers  






Hi , I am posting some interview ques . what is the use of cursors ? what is the diff between select and cursor ? bith are used for data retrival .. rite?

2 Answers   Deloitte,


How can you find out the # of rows updated after an update statement?

0 Answers  


What are the full forms of spufi and dclgen and why are they used?

0 Answers  


How will you return the number of records in table?

0 Answers  


Explain package in db2 and its advantages?

0 Answers  


What is difference between isnull and coalesce?

0 Answers  


What is db2 command?

0 Answers  


Categories