----- Original Message ----- From: <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Monday, June 15, 2009 11:15 AM
Subject: [RBASE-L] - Re: Cursor operation continues after end of data


Mike:   You will never convince me that your way is better!!   ;-)

I suppose there is a "double test" -- it does have to figure out each
loop if 1 is still = 1 ...   But the best advantage is that there is only
ONE fetch.   Come on...  how many times have you added a column
to the declare statement and changed one fetch but forgot to change
the other fetch?????

Never. I always change the first fetch then copy and paste it to the second.

I know there are two fetches and even in the face of diminishing brain cells, I can still count to two... ;-)



Karen


If I were traversing a large dataset, I would rather use two fetches with

only one test for TRUE per loop instead of the obvious double test in this

format.  So as a matter of course, large dataset or small, I stick with
the
double fetch for standardization.


----- Original Message ----- From: "Dennis McGrath" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Friday, June 12, 2009 10:06 AM
Subject: [RBASE-L] - Re: Cursor operation continues after end of data


This is my personal preference too.
There is only one fetch to maintain, and the program flow is totally
unambiguous.
Dennis McGrath

________________________________
From: [email protected] [mailto:[email protected]] On Behalf Of
[email protected]
Sent: Thursday, June 11, 2009 4:56 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Cursor operation continues after end of data

Randy:   Marc is right.   It is evaluating true because it is looking at
the
LAST command that's before your while loop. FWIW, I never use the "WHILE

SQLCODE <>100 THEN" structure because of that. I just don't trust to know

what command it is evaluating.  I always do this:

DECLARE c1 CURSOR FOR SELECT .....
OPEN c1
WHILE 1 = 1 THEN
  FETCH c1 INTO vars....
  IF SQLCODE = 100 THEN
      BREAK
  ENDIF
ENDWHILE



--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE: Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, place any text to search for.
================================================


Reply via email to