Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I keep base cursor from being affected
Message
De
12/04/2007 14:14:04
 
 
À
12/04/2007 14:01:08
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01215122
Message ID:
01215137
Vues:
15
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform