Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Use Conditional Delete using SQL
Message
From
28/02/2014 14:50:28
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01595554
Message ID:
01595557
Views:
34
Thanks Madam
Regards

>>Hi,
>>
>>I have a cursor with three columns. Detail, POSC, POSR
>>I am Deleting records from it like This
>>
>>
>>Delete From ABC  Where ;			
>>			posC=0 Or ;
>>			posR=0 Or ;
>>			posR>posRTOPMOSTVALUE Or ;
>>			GETWORDNUM(POS,Getwordcount(Alltrim(POS))-3)='(Page'
>>
>>
>>
>>I want to Delete Based on above critera, however I Do not want to Delete one record having Detal="ENDP" although it is having corresponding value of posR=0 or posC=0
>>
>>i.e I want to delete all posc, posr etc based on above but not the record having DETAIL="ENDP"
>>
>>What additional condition I need to Add on the above
>>
>>Regards
>>
>>
>>
>>
>>
>>
>>Using the above SQL for Delete
>
>
Delete From ABC  Where ;			
>			(posC=0 Or ;
>			posR=0 Or ;
>			posR>posRTOPMOSTVALUE Or ;
>			GETWORDNUM(POS,Getwordcount(Alltrim(POS))-3)='(Page') AND NOT Detail = 'ENDP'
Harsh
Previous
Reply
Map
View

Click here to load this message in the networking platform