What is a cursor?

Answers were Sorted based on User's Feedback



What is a cursor?..

Answer / guest

A cursor is a programming device that is used to handle the
rows that are returned by the query as the host language
(cobol) can handle only one row at a time. its also a small
file that has the result set. The cursor has to be
declared,opened, fetched and closed to access the data
returnee by the query.

Is This Answer Correct ?    2 Yes 0 No

What is a cursor?..

Answer / vinod babu bachina

In DB2 cursor is used to fetch more than one row from a DB2
table. But cursor can fetch only one row at a time. Suppose
if ur retrieving more than one row from table , u have to
use cursor only. If u use SELECT instead of cursor then it
leads to error '' more than one row selected in select'.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More DB2 Interview Questions

What are the Isolation levels possible ?

5 Answers  


Where do you specify them?

0 Answers  


What is cursor stability?

1 Answers  


When is the access path determined for dynamic SQL?

2 Answers  


What is lock contention?

1 Answers  






Mention the downsides of page level lock.

0 Answers  


My sql statement select avg(salary) from emp yields inaccurate results. Why?

0 Answers  


What does it mean if the null indicator has -1, 0, -2?

1 Answers  


What is lock escalation in db2?

0 Answers  


What is the error code -803 ?

3 Answers  


Shall i use this query to retrieve first 4 records, Select empno, sal from emptbl where empno < 5. like this can we fetch first 100 records?

3 Answers  


Hi i need to write a query on the following requirement. SELECT COMM_TEXT INTO :WS_MIKM_COMM_TEXT FROM MPIPROD.MIKMV01 WHERE ACCOUNT_NO = :WFD_ACCOUNT_NO AND (SUBSTR(COMM_TEXT,1,39) = :WS_COMMENT_TEXT AND SUBSTR(COMM_TEXT,47,14) = :WS_DENY_DESC) OR (SUBSTR(COMM_TEXT,1,39) = :WS_COMMENT_TEXT) The above query is to be modified. The requirement is if both the fields are equal then that has to be given priority. In the above query if it satisfies any one it comes out without checking if both being equal is possible.

1 Answers  


Categories