Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to execute more than 1 update with SQLEXE
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01522041
Message ID:
01522076
Views:
47
>>if SQLEXEC(nHandle, m.lcSQL) <0
>> &&Check the actual error with aerror()
>>ENDIF
>>
>>I think your code was OK also, but better to write them as separate lines and you should always check the return value of SQLExec.
>
>Thank you, Naomi. Just as I read your message I realized why I had the problem last night. I am trying to make my code work on both VFP and SQL Server. And I was testing last night on VFP. And of course, this type of syntax would not apply to VFP at all. So I will probably execute each UPDATE separately. I wonder, though, if I could enclose these two UPDATE (for SQL Server) with Transaction so that I can undo changes if one of the UPDATEs fails. I will test it.

It may be better to enclose them into explicit transaction. Most likely they already will be part of implicit transaction, but better to not rely on this.
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