Karen: Thank you. "Resettable Cursor" is the section title dealing with OPEN c1 RESET in the RBASE Cursors Explained document.

Boiling my question down:

Can cursor c1's data set be dynamically altered within cursor c1's WHILE ... ENDWHILE loop, so that subsequent loop cycles use the modified cursor's data? Will OPEN c1 RESET, within a WHILE ... ENDWHILE loop, do that?

Or should I
(a) make the change to c1's source table;
(b) "bookmark" my location in c1 (variable-ize the current value);
(c) ENDWHILE the loop
(d) DROP c1
(e) loop back around
(f) DECLARE c1 with the now-modified data set
(g) jump to the bookmarked location
(h) continue

Deep weeds available, if you want them.

Much appreciated, Bruce

Bruce A. Chitiea | SafeSectors, Inc.
112 Harvard Ave #272 | Claremont CA 91711-4716 | USA
[email protected] | +011 (909) 238-9012 c | +011 (909) 912-8678 f

------ Original Message ------
From: "'Karen Tellef' via RBASE-L" <[email protected]>
To: "[email protected]" <[email protected]>
Sent: 12/18/2021 5:46:16 AM
Subject: Re: [RBASE-L] - Resettable Cursor

Hi Bruce! I'm unclear what you mean by "resettable cursor". Do you mean using the OPEN c1 RESET command within a DECLARE CURSOR loop?

If so, quickly I'll mention that I use the RESET all the time if I am embedding a second cursor within the first cursor, but that's the only time I use it. And if you want to see my syntax for doing that, let me know


Karen



-----Original Message-----
From: Bruce Chitiea <[email protected]>
To: [email protected] <[email protected]>
Sent: Fri, Dec 17, 2021 9:32 pm
Subject: [RBASE-L] - Resettable Cursor

Peace to all:

Can someone please send an example of a 'Resettable Cursor' [1] in use? I understand the use of scrolling, but ...

Wondering if the contents of a scrolling cursor can be modified during processing between the WHILE sqlcode <> 100 THEN and ENDWHILE statements.

I'm building time-series data for use in charting parallel data series, and using a cursor to insert zero values for time periods with no data, so that all the series align. When a year, say, is found to be missing, I'd like to pop that missing year into the cursor's source table, then have the cursor redefined "on the fly", so that the next cursor-retrieved value may be evaluated relative to the newly inserted value. Especially handy when there's a multi-year gap, when RELATIVE -n would now have the right value to land upon.

Seems like the cursor needs to be reset for that to happen.

On the right track?

Ever grateful, Bruce

Bruce A. Chitiea | SafeSectors, Inc.
112 Harvard Ave #272 | Claremont CA 91711-4716 | USA
[email protected] | +011 (909) 238-9012 c | +011 (909) 912-8678 f

 [1] As noted in From the Edge: "R:BASE Cursors Explained" (01/04/2021)
--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
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]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/eme9daf667-df30-4b9b-bd6c-ce382dcc669e%40pathfinder <https://groups.google.com/d/msgid/rbase-l/eme9daf667-df30-4b9b-bd6c-ce382dcc669e%40pathfinder?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
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]. To view this discussion on the web visit https://groups.google.com/d/msgid/rbase-l/1434955470.2527171.1639835176988%40mail.yahoo.com <https://groups.google.com/d/msgid/rbase-l/1434955470.2527171.1639835176988%40mail.yahoo.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/em3cdd33f5-6c03-436a-be94-03feb59a7ab3%40pathfinder.

Reply via email to