Hi All,
I am new to this forum and this is my first posting.
As you all must be knowing that a single FETCH statement can be used to retrieve multiple rows of data from the result table of a query as a rowset in DB2 V8.
Fetch works with a host variable array in which each element of the array contains a value for the same column. Changes to allow host variable arrays have been made to COBOL.
Declare C1 CURSOR
with ROWSET POSITIONING FOR SELECT * from EMP
FETCH ROWSET STARTING AT ABSOLUTE 20 FROM C1 FOR 10 (or 20,50, 100...) ROWS
INTO ….
In the INTO; :hva1, :hva2, …..the first host variable array corresponds to the first column’s output, the second host variable array corresponds to the second column’s output, and so on.
Thanks in advance.
Basically I need to know how to define arrays in WS section and then use the Fetch statement in the program.