Tom, I often find that the sort of problem you are getting is due to a simple syntax problem – missing comma or quote.
It seems to be one of those error messages that is true in itself – it can’t see the ENDxx because something else is wrong - but sometimes misleading in its cause. I suggest you check and recheck that you really have got everything correct and that the syntax is “by the book” rather than “it works on its own”. Good luck, Alastair. From: TOM HART Sent: Sunday, January 15, 2012 2:40 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Declare cursor problem 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

