Hi MIke

I assume this was directed at my answer.

Notice my WHILE loop does NOT check for the SQLCode:

My structure was:

DROP cursor
DECLARE cursor
OPEN cursor
WHILE #PI <> 0 THEN
   FETCH
   IF SQLCODE <> 100 THEN
      BREAK
   ENDIF
   --commands for what to do after FETCH
ENDWHILE
DROP cursor

This structure has worked well for me for years.  Am I missing something?

David Blocker
[EMAIL PROTECTED]
781-784-1919
Fax: 781-784-1860
Cell: 339-206-0261
----- Original Message -----
From: "MikeB" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[email protected]>
Sent: Monday, February 07, 2005 9:50 AM
Subject: [RBG7-L] - Re: Fetch command


>
> > *(It's inefficient in your coding to have TWO Fetch commands, one inside
the
> > loop and one outside
> > Fetch Rt1 into vProjID INDIC ivPJD, vQT1 INDIC ivQT1, vCODE INDIC
ivCODE, +
> > vSTARTDTE INDIC iVSTARTDTE, vENDDTE INDIC ivENDDTE
>
> I agree with your changes Except for the theory on the Fetch...
>
> With the first Fetch before the beginning of the While loop, Fetch is
called
> the Exact "number" of times to circumvent the recordset, so the Only thing
that
> is different is writing the Fetch statement Twice in Code.
>
> This is small potatoes compared to the Condition checking in your While
Loop.
>
> Having the While check for the SqlCode Once per Loop would be more
desirable
> than Checking Twice per Loop in your scenario, Once for the While
condition and
> Once for the If condition...
>
> I understand the desire to use the Fetch only once, because you have
reduced
> the chance for error in the Fetch by Half, but for my money, I'll stick to
the
> old way.
>

Reply via email to