How to Commit/Rollback stored procedure based on return value in Snowflake?
问题 I have a javascript stored procedure that return boolean. I want to be able to call this stored procedure inside a transaction and test the return value before committing the transaction. BEGIN; SET result = CALL my_stored_proc(); IF $result = true COMMIT; ELSE ROLLBACK; The stored procedure will return false if there is an exception or if there is some missing values based on business logic. How do I achieve this in Snowflake? EDIT: I tried the following and it did not work. The transaction