Tom, Are you sure that each column in the SELECT statement returns a value. If not you may need indicator variables for any column that may contain a NULL value.
Jim Bentley American Celiac Society [email protected] tel: 1-504-737-3293 >________________________________ > From: TOM HART <[email protected]> >To: RBASE-L Mailing List <[email protected]> >Sent: Saturday, January 14, 2012 8:40 PM >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 > > >

