Karen, This is an excellent article. A couple of things for you.
1. Since you are dealing with an OLD cursor, make sure you SET all the needed VARIABLE datatypes and values to NULL completely outside the CURSOR. You can set the values inside the CURSOR but you can't (shouldn't) really define vars inside the CURSOR. 2. Because of all your GOTO's inside the CURSOR, you should really explore the SCROLL feature in your cursor. The cursor is looking for the GOTO Labels from top to bottom repeatedly. Telling the cursor to go forward or backward a certain number of rows (since you know where the labels are) would most certainly speed up the cursor. Jan -----Original Message----- From: karentellef via RBASE-L <[email protected]> To: [email protected] Date: Fri, 28 Apr 2017 12:16:47 -0400 Subject: Re: [RBASE-L] - From The Edge: R:BASE Cursors Explained Cool, read the whole document!! Unfortunately not alot of it applies to my specific situation since there are no nested cursors and it's never updating any tables. The original writer of the program also did a nice job of writing the initial "declare" command to pull in as much data as needed, including some calculations right there rather than within the loop. But one thing jumped out, that you say that a "set var" is slightly faster than a "select into". I was thinking of converting all those "set var" statements, so I won't bother now! Karen -----Original Message----- From: A. Razzak Memon <[email protected]> To: rbase-l <[email protected]> Sent: Fri, Apr 28, 2017 10:56 am Subject: [RBASE-L] - From The Edge: R:BASE Cursors Explained Friday, April 28, 2017 >From The Edge.: R:BASE Cursors Explained Product.......: R:BASE X, R:BASE X Enterprise (Version 10) Build.........: 10.0.2.20411 or higher www.rupdates.com [http://www.rupdates.com/] Keywords......: Commands, CURSOR, DECLARE, FETCH, SELECT An R:BASE cursor is a valuable programming control structure that enables traversal reference over the records in a database. It is a pointer to rows in a table that can step through rows one by one, performing the same action on each row. A cursor can be set to point to all the rows in a table or to a subset of rows. A cursor is set using the DECLARE CURSOR command. R:BASE supports several types of cursors and cursor structures including: . Multi-Table Cursors . Non-Updateable Cursors . Nested Cursors . Resettable Cursors . Scrolling Cursors All of the cursors above and examples of Optimizing Cursors are described within the R:BASE Cursors Explained technical document. >From The Edge: http://www.razzak.com/fte [http://www.razzak.com/fte] Article Title: R:BASE Cursors Explained Very Best R:egards, Razzak. www.rbase.com [http://www.rbase.com/] www.facebook.com/rbase [http://www.facebook.com/rbase] -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] [mailto:[email protected]]. For more options, visit https://groups.google.com/d/optout [https://groups.google.com/d/optout]. -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] [mailto:[email protected]]. For more options, visit https://groups.google.com/d/optout [https://groups.google.com/d/optout]. -- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

