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
How would you find out the total number of rows in a db2 table?
Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....
In an sql table that is embedded, what is the procedure to retrieve rows that are part of a db2 table?
What is data manager?
What are the contents of a dclmgen?
What is commit in db2?
How to compare data between two tables in db2?
What is db2 look?
What is collection in db2 bind?
Define data page.
How can we read records for specific member in CL? AND rpg?
What is cobol db2?
How to find the number of rows in a db2 table?
File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?
How to resolve deadlock issue