What is a cursor?
Answers were Sorted based on User's Feedback
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 |
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 |
What are the Isolation levels possible ?
Where do you specify them?
What is cursor stability?
When is the access path determined for dynamic SQL?
What is lock contention?
Mention the downsides of page level lock.
My sql statement select avg(salary) from emp yields inaccurate results. Why?
What does it mean if the null indicator has -1, 0, -2?
What is lock escalation in db2?
What is the error code -803 ?
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?
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.