Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete from ...select issue
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Delete from ...select issue
Miscellaneous
Thread ID:
01254242
Message ID:
01254242
Views:
58
Hi All,
i've syntax like below ,
main target deleting records from main table (user01) which is not matching records on userforms table.
Below codes running but not happens :( exactly first SQL finds the differences between two table but last codes doesnt
delete records from user01 tables , where is the wrong ? or how can i delete records from user01 table that doesnt match records as crsDiff01 cursor records ?

TIA
lcSource01=[user01]
lcTarget01=[userforms]

&& finding not exist records in user01 tables as userforms table
Select * From (m.lcSource01) Where formName Not In ;
	( Select formName From (m.lcTarget01) )  ;
	inTO Cursor CrsDiff01 Readwrite NOFILTER

If _Tally # 0 && 
	Select user01
	Delete From user01 where CrsDiff.formName=user01.formName in user01
	Tableupdate(2,.T.,[user01])
	Messagebox([Records has been deleted from user rights table that doesnt matching user rights items table..],64,[Info],3)
Endif
Next
Reply
Map
View

Click here to load this message in the networking platform