how to fetch multiple records without using cursor
Answer Posted / mahyn
However if we want to fetch and process multiple rows
without using cursor, we can do with the below psuedo code.
assume that seq_num is unique.
h-seq initilized with spaces.
perform until sqlcode = +100 or h-seq >= 500
exec sql
select seq_num into :seq-num from tablename
where seq_num > :h-seq
order by Seq_num with ur;
fetch first 1 row only
end-exec
operations
move seq-num to h-seq
end-perform
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain in brief how does db2 determine what lock-size to use?
What is access path in db2?
What are host variables in db2?
What is null value in db2?
what is the role of the cursor in db2?
What is buffer pool in the db2 database?
What is a bind card?
List some fields from sqlca?
what is utility for parm lib
What is runstats utility in db2?
Name the various locking levels available?
What are packages in db2?
I have a subprogram B calling from mainprogram A.I have opened a cursor in A ,Can i fetch the same cursor in subprogram B , If yes , Please explain the reason?
What is the max length of sqlca?
Is db2 a mainframe?