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
What is innodb buffer pool?
When reorg is used?
What is the syntax for FETCH in DB2 ?
What is phantom read in db2?
What is the difference between dbm cfg and db cfg file in db2 ?
What is the use of db2 optimizer?
Is it possible to create an Instance in DB2 using DB2 Control Center ?
What does a deadlock mean in DB2?
How can you find out the # of rows updated after an update statement?
What is node in db2?
What is clone table?
What is explain in db2?
What is the maximum length of sqlca?
What is a Foreign Key?
What is database alias db2?