Post Closed
51
Views
2
Comments
Getting an error while running SQL Update query

It does update the record in table but it gives below error and exit the process.

Query:-

Update  {APIRequestTbl} set {APIRequestTbl}.[StatusCount] = @setVal where  {APIRequestTbl}.[Id] = @RecID;

EXECUTE('COM'+'MIT');

Error:-

Database returned the following error: Error in advanced query SQL1: Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0. Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0. 

ExportFileTest251023.oml
2026-01-03 13-44-38
Erwin van Rijsewijk
Champion

Remove the strange EXECUTE('COM'+'MIT'); 

Your SQL will be committed automatically when the serveraction where it is in is completed.

If you want to force a commit, place the CommitTransaction serveraction just after your SQL

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Please don't double post the same question, I close this discussion, and discussion can continue on the duplicate post:

https://www.outsystems.com/forums/discussion/92283/getting-an-error-while-running-sql-update-query/