G'day Frank,

The label being inside a while loop will sometimes produce the error you
described.
I have adopted two ideas learned from the list and would code it this way.
Reasons?  No while loop to stumble on and no second fetch to maintain.

At 16:07 27/04/01 -0700, you wrote:
>I have a client that has the following code:
>
>DECLARE C1 CURSOR FOR  SEL DISTINCT Cust FROM AuditCharge
>OPEN C1 RESET

>LABEL StartCur
>FETCH C1 INTO +
>   vCust IND v1
>IF SQLCODE = 100 THEN
>    GOTO ALLDONE
>ENDIF
>WRI .vCust AT 22 29
>
>SEL SUM (SubTot+TaxAmt) INTO vUnPd IND v1 FROM ApplyPay WHERE Cust = .vCust
>SEL SUM (PaymentAmt-PaymentUsed) INTO vUaPay IND v1 FROM ApplyPay WHERE 
>MethType IN (240 242 250) +
>        AND Cust = .vCust
>SET V vCurBal = (.vUnPd-.vUaPay)
>UPDATE Cust SET CurBal = .vCurBal WHERE Cust = .vCust
>
>GOTO StartCur
>LABEL ALLDONE
>CLOSE C1
>DROP CURSOR C1

Warmest regards,


Tom Grimshaw
coy:    Just For You Software
tel:    61 (0)2 9552 3311
fax:    61 (0)2 9566 2164
email:  [EMAIL PROTECTED]
mobile: 0414 675 903
street: 3/66 Wentworth Park Rd  Glebe  NSW  2037
post:   PO Box 470  Glebe  NSW  2037  Australia

     _/_/_/_/_/_/_/_/ _/_/_/_/_/_/ _/       _/    _/_/_/_/_/
           _/         _/            _/     _/   _/
          _/         _/              _/ _/     _/
         _/         _/_/_/_/         _/        _/_/_/_/_/
        _/         _/               _/                 _/
_/   _/          _/               _/                 _/
   _/            _/               _/       _/_/_/_/_/

Reply via email to