![]() * write out the LastRRN to the page so it can be retrieved on the next call. ![]() Notice the FOR UPDATE OF clause in the cursor declaration. Here’s an example of a good cursor declaration. ![]() When you tell SQL which columns will be updated, SQL knows that it can use access paths over other columns. * optimize for rows for read onlyĬ+ DECLARE C1 INSENSITIVE SCROLL CURSOR FOR S1Ĭ dow (SQLCOD 100) and (Count < PerPage) SQL will consider using access paths to speed up the update, but it will not use an access path over an updated column. * Build Dynamic SQL into DynSQL String Making sure to get the RRN of each record as well * Do some checking to make sure PerPage is > 0, if not, set it to a default * Read Records Per Page and Last RRN from Web PageĬ eval PerPage = c2n2(ZhbGetVar('PerPage'))Ĭ eval LastRRN = c2n2(ZhbGetVar('LastRRN')) If you were using it as a subfile application you would need to find other ways to retrieve/store PerPage and LastRRN (and FirstRRN if you want to be able to page backwards). This example also uses CGIDEV2 as it is a web application. I apologize it's not free format, but it is easily converted should you want to do that. Here is the example I had in my archives. An example of using a scrollable cursor in RPG was requested.
0 Comments
Leave a Reply. |