Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I keep base cursor from being affected
Message
From
12/04/2007 14:14:04
 
 
To
12/04/2007 14:01:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01215122
Message ID:
01215137
Views:
14
>In the following code the psCursort keeps growing and goes into an infinte loop. What is causing this?
>
>
>SELECT * FROM psCursor INTO CURSOR psCursort
>
>y = y + 1
>
>SCAN
>	
>getPSString = "SELECT pinbr, itdsc, ittyp, cinbr FROM amflib6.pstruc" +;
>" Join amflib6.itemasa On amflib6.itemasa.itnbr = amflib6.pstruc.pinbr" +;
>" Where pinbr = '" + psCursort.partno + "'"
>=SQLEXEC(testconn, getPSString, 'getPSQuery')
>	
>SELECT getPSQuery
>	
>Scan
>		
>INSERT INTO psCursor(itemid, partno, descptn, itemtype, childpn, olinelev, faiid, faistatus) ;
>Values(psCursort.itemid, getPSQuery.pinbr, getPSQuery.itdsc, getPSQuery.ittyp, getPSQuery.cinbr, ALLTRIM(STR(y)), "", "")
>	
>EndScan
>	
>EndScan
>
>
It seems you designed endless loop, by scanning the same cursor that you inflate within the loop. By the way, if you want to move data from one cursor to another then use:
Insert Into cursor1 (...) select ... from cursor2
i.e. you don't need to scan it.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform