I normally use a FETCH NEXT to read multiple rows into a data structure to process into my subfile and let the system handle PageUp. I wanted to try this same thing using a page at a time subfile and had problems. My FETCH RELATIVE statement is not working like everything I read says it should. It is acting just like a FETCH PRIOR. I used a SCROLL CURSOR and even a DYNAMIC SCROLL CURSOR. This pgm will still only read 1 single prior record before current cursor position. Has anybody else run into this problem?
Code:
Exec SQL Declare C1 scroll cursor for vendors; Exec SQL prepare vendors from :@sqlstatement; Exec SQL open C1; If PageDown; Exec SQL fetch next from C1 for 14 rows into :@subpage; elseif PageUp; Exec SQL fetch relative -14 from C1 for 14 rows into :@subpage; endif;
Comment