Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Needed To Update Records
Message
From
20/02/2013 15:14:11
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01566306
Message ID:
01566580
Views:
34
Thanks, I Used the code bit Still some records which are though exactly the same in both the tables but are not deleted in NM.
Here is the code Which I used. I used it with Alltrim and Without Alltrim also.

In NM Table Accountno is in Character and in M it is in Digits.

Delete NM From New_Master NM inner join Master M on VAL(NM.Accountno)=M.Accountno AND ;
ALLTRIM(NM.PhoneNo)=ALLTRIM(M.PhoneNo) and ;
ALLTRIM(NM.Exchange)=ALLTRIM(M.Exchange) AND ALLTRIM(NM.Firstname)=ALLTRIM(M.Firstname) AND ;
ALLTRIM(NM.Lastname)=ALLTRIM(M.LastName)
>>I am using the following SQL to Delete the Data in Table New_master. IF all the fields of New_master Matches With the Master.DBF the row should be deleted.
>>
>>My SQL is not working, please suggest the required SQL.
>>
>>MY SQL is as Follows
>>
>>
>>DELETE FROM New_Master WHERE Accountno In (Select Accountno Number FROM Master WHERE ;
>>New_master.Phoneno= Master.Phoneno AND New_master.Exchange= Master.Exchange AND ;
>>New_master.firstname= Master.firstname AND ;
>>New_master.lastname=ALLTRIM(Master.Lastname))
>>
>>
>>Kinldy Provide The SQL for The above Task
>>
>>Regards
>
>You can use delete from syntax here, e.g.
>
>delete NM from New_Master NM inner join Master M on NM.PhoneNo = M.PhoneNo and ...
Harsh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform