Reputation: 53
I am getting below error message while executing a Snowflake stored procedure from tDBrow in Talend. The same stored procedure executes fine when executed from Snowflake Web UI. Could you advise why I am getting scoped transaction error when executing from Talend but not from Web UI.
ERROR:
Stored procedure execution error: Scoped transaction started in stored procedure is incomplete and it was rolled back.
Upvotes: 0
Views: 1956
Reputation: 53
The problem is solved. When the procedure is called from Talend, the transaction starts before execution of the procedure and it finishes after the execution.
I should have explicitly defined the scope of transaction inside the procedure. Therefore, I added these two lines at the beginning and end of the procedure (before return) respectively:
snowflake.createStatement({sqlText: "BEGIN TRANSACTION"}).execute();
snowflake.createStatement({sqlText: "COMMIT"}).execute();
Upvotes: 3