how to fetch multiple records without using cursor
Answer Posted / m4io
it is not possible in db2 v8 : you still need a cursor.
However : you can fetch 100 rows in one fetch.
01 host-variables.
05 HV-col1-ARRAY PIC s9(04) COMP OCCURS 100 TIMES.
05 HV-col2-ARRAY PIC x(40) OCCURS 100 TIMES.
05 HV-vcol3-ARRAY OCCURS 100 TIMES.
49 HV-vcol3-len-ARRAY PIC s9(04) COMP.
49 HV-vcol3-txt-ARRAY PIC x(40).
05 HV-IND2-ARRAY PIC s9(04) COMP OCCURS 100 TIMES.
I
DECLARE csr1 CURSOR WITH ROWSET POSITIONING for select
col1, col2, vcol3 from ...
open cursor
FETCH NEXT ROWSET FROM csr1 FOR 100 ROWS
INTO :HV-col1-ARRAY,
:HV-col2-ARRAY:HV-IND2-Array,
:HV-vcol3-ARRAY
| Is This Answer Correct ? | 13 Yes | 2 No |
Post New Answer View All Answers
What is table space in db2?
Mention the different locking levels that are available in db2.
What is the physical storage length of date data type?
How can the duplicate values be eliminated from db2 select?
What is precompiler in db2?
What is the physical storage length of time data type?
File not opened because library is *PROD and debug is UPDPROD(*NO). ? what may be the reason? how to solve it..?
What is concurrency?
What is db2?
What is load replace in db2?
What is buffer pool?
What is the physical storage length of the data types: date, time, timestamp in the db2 database?
What is multi row fetch in db2?
How can the firstname and the lastname from the emp table be concatenated to generate complete names?
How many databases can be created inside an instance in db2 ?