Did you try setting WHILEOPT OFF? I don't know why but sometimes that makes things work. Mike
On Jan 14, 2012, at 9:40 PM, TOM HART <[email protected]> wrote: > I have the following that works, the pause 2 is only used to verify that the > cursor is going thru the while, and it is. > > select StoreNum into vStoreNum from StoreInfoTab where count = 1 > DECLARE cursor1 CURSOR FOR SELECT StoreNum from AllStoreInfo where storenum > <> '12' > OPEN cursor1 > FETCH cursor1 INTO zStoreNum INDICATOR zi1 > WHILE sqlcode <>100 THEN > pause 2 using .zstorenum > select > StoreName,FolderOutName,FolderInName,StoreInventory,ChkInventory,StoreSales,+ > ChkSales,StoreConsigner,ChkConsigner,StoreCustomer,ChkCustomer,StoreConPaid,ChkConPaid,+ > StoreCustTrans,ChkCustTrans into vStoreName,vFolderOutName,vFolderInName,+ > vStoreInventory,vChkInventory,vStoreSales,vChkSales,vStoreConsigner,vChkConsigner,+ > vStoreCustomer,vChkCustomer,vStoreConPaid,vChkConPaid,vStoreCustTrans,vChkCustTrans+ > from AllStoreInfo where StoreNum = .zStoreNum > *****this is where I put the updating routine, which works fine on its > own****** > FETCH cursor1 INTO zStoreNum INDICATOR zi1 > ENDWHILE > DROP CURSOR cursor1 > return > > I am wanting to use this to update information from remote databases, so in > the middle of this I put my other update routine, which on its own works > fine, but when I put it in the routine I get the error message about no > endwhile, endif. Like I said I have just placed the routine in the fetch. > Tom Hart

