Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No Duplicates
Message
From
05/05/2010 09:30:35
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01462570
Message ID:
01463199
Views:
23
>Ok, my last night idea worked - not that I would recommend it:
>
>
>LOCAL lnI
>CREATE CURSOR crsTest (IDFld I, FName c(10))
>FOR lnI = 1 TO 10
>  INSERT INTO crsTest (FName) VALUES ('Ken')
>  INSERT INTO crsTest (FName) VALUES ('David')
>  INSERT INTO crsTest (FName) VALUES ('Michael')
>  INSERT INTO crsTest (FName) VALUES ('Robert')
>NEXT
>
>INDEX on fName TAG fName
>
>PRIVATE pnRec, pcName
>
>pnRec = -1
>pcName = crsTest.FName
>
>replace IDFld WITH IIF(crsTest.FName == m.pcName, NVL(_VFP.SetVar('pnRec', m.pnRec+1),1), ;
>NVL(_VFP.SetVar('pcName', crsTest.FName),1) * NVL(_VFP.SetVar('pnRec', 0),1)) * (m.pnRec + 1) IN crsTest NEXT 40
>
>browse
hmm what if i have a table with 1000 records that insert will still work?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform