‎2021 Dec 23 12:42 AM
Dear All,
I am using an executable program and trying to update a Z* table. But unfortunately it does not get updated until I specify explicitly "commit work", so using commit work in the executable program is that fine or any precautions to be taken. I have multiple conditions in my program and I have to use commit work multiple times. Our database is Hana.
‎2021 Dec 23 7:02 AM
When your program finish (with no errors) there is an implicit COMMIT WORK.
You could use explicit COMMIT WORK in your code, you just have to be sure to commit only what you are supposed to commit. The statement COMMIT, will commit all the waiting update you have done. So if some have to be escluded, just do a rollback
‎2021 Dec 23 10:31 AM
Here, I'm just nitpicking, as usual :). It's not a COMMIT WORK, it's a database commit. It's not when the program finishes that there's an implicit database commit, it's when the (next) screen "flushes" (is displayed).
It's always good to mention explicitly COMMIT WORK (except if you don't want to commit on purpose) because if you have a program doing SUBMIT AND RETURN, right after SUBMIT, the database updates have not been committed.
‎2021 Dec 23 12:11 PM
‎2021 Dec 23 1:58 PM
of course not, I'm not here to get any kind of reward (I would refuse any reward anyway, even Nobel price, as you like joking ;-)), just providing the most precise answers to people. Okay probably only experts can understand, but some people are very curious.