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
Why do we need reorg in db2?
Name the lockable units in DB2?
What is dbrm?
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
Which components manage deadlocks in db2?
What is dbrm in db2 database?
Suppose pgm A calling Pgm B .Pgm B has some Db2 program. at the time of compilation should plan and package will be created for both A and B or only B? What is the concept?
What is nvl in db2?
What is explain plan in db2?
What is deadlock in db2?
How do you select a row using indexes in db2?
What is concurrency?
What is database manager in db2?
What is runstats utility in db2?
Give a brief description of db2 isolation levels?