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 the result of open cursor statement?
On which levels locks can be applied?
What is the maximum No of rows per page?
How many databases can be created inside an instance in db2 ?
How do I delete a table in database?
What is the difference between spufi and qmf?
Is it possible using max on a char column?
What is dclgen (declaration generator)?
can any one provide me the link for the db2 v7 & db2 v8 manual for Z/os? i need to know about the syntax of REORG in both versions & need to know the difference as well
Define data page.
How do you find the maximum value in a column in db2?
If the cursor is kept open followed the issuing of commit, what is the procedure to leave the cursor that way?
What is reorg and runstats in db2?
What is buffer pool and list some of them?
Mention the location where the output received from explain statement is stored.