On Thursday, December 7, 2023, arun chirappurath <arunsnm...@gmail.com>
wrote:
>
>
> Can someone guide me to "write a sql block which will commit if both
> updates are successful else it will have to be rolled back"?
> would like to explicitly specify both commit and rollback in code..
>
>  I would like to turn off the autocommit then execute the query.
>

As documented under DO if you make an explicit transaction then execute the
DO it cannot have transaction control commands.  If you allow it to
“auto-commit’’ then it can.  Though in that case writing either rollback or
commit for such a simple linear procedure becomes pointless since a
transaction will already commit or rollback appropriately depending on
whether the procedure provokes an exception.

David J.

Reply via email to