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
Who uses db2?
What action db2 takes when a program aborts in the middle of a transaction?
Which are the db2 tools to protect integrity of the database?
Is the primary key a clustered index?
How do you pull up a query which was previously saved in qmf?
What is bind package and plan in db2?
How do I add a column to a table in db2?
What is a page in db2?
What are host variables in db2?
Differentiate between cs and rr isolation levels? Where do you specify them?
If anyone has IBM Certification Dumps pls forward to me & also let me know what are the Certification Codes that are available in DB2
What is temporal table in db2?
In case if at some point of time db2 is down, would that impact the pre-compilation process of a db2-cobol program?
What is db2 plan table?
What is cursor in dbms?