Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No Duplicates
Message
 
 
To
05/05/2010 08:54:43
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01462570
Message ID:
01463195
Views:
26
>>Since we're using INNER JOIN, only records that joined, would be deleted. According to Hugo's blog I gave you in the very top of this thread, it may be not ANSI standard to use JOIN in Update/DELETE commands.
>>
>>Alternative way to write the same delete would be
>>
>>delete from myTable where fName in (select fName from Dups)
>>
>>---------------------------------------------------------------------------------------------------------------------------
>>BTW, last night I think I invented an interesting way to number records in one replace command, planned to even test it this morning, but forgot, of course.
>>
>>I may try it now then.
>
>
>or or or u could tell me an ill test it for you :D

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
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform