Guest.Visitor
Thanks for the tip, but I\'d like to know if there\'s a way with this method to A) get not just the first 10, but 11-20, 21-30, in order to "page" through a result set and B) retrieve the total number of records in a result set without reading each one. We are now reading the entire set each time, and using hidden fields to keep track of which records have their detail displayed so we can display paging links kind of like: Prev 10 11-20 shown Next 10 of 96 total Thanks in advance for any help.
Guest.Visitor
sgi400 wrote: > Thanks for the tip, but I\'d like to know if there\'s a way with this > method to A) get not just the first 10, but 11-20, 21-30, in order to > "page" through a result set and B) retrieve the total number of > records in a result set without reading each one. We are now reading > the entire set each time, and using hidden fields to keep track of > which records have their detail displayed so we can display paging > links kind of like: Prev 10 11-20 shown Next 10 of 96 total I believe you would use the FETCH command. The following is from the V5R2 SQL Manual: EXEC SQL DECLARE C1 CURSOR FOR SELECT DEPTNO, DEPTNAME, MGRNO FROM TDEPT WHERE ADMRDEPT = \'A00\'; EXEC SQL OPEN C1; while (SQLCODE==0) { EXEC SQL FETCH C1 INTO :dnum, :dname, :mnum; } EXEC SQL CLOSE C1; Bill
Please login to make comments.
User Rating: / 0
PoorBest 

WHITE PAPERS

The following White Papers can be found at the MC White Paper Center

 

 


   MC-STORE.COM