ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

BEGIN TRANSACTION & ROLLBACK ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BEGIN TRANSACTION & ROLLBACK ?

    In MSSQL Server when running updates manually I can start with BEGIN TRAN and then after the update if I made a mistake I can run ROLLBACK to undo the update, or COMMIT if the update is correct.

    Is there an equivalent in IBM SQL running from Client Access Query window ?

  • #2
    <deleted as potentially misleading>
    Last edited by JonBoy; January 11, 2023, 11:39 AM.

    Comment


    • #3
      1. You can set the use of commitment control in the Connection (JDBC Configurations --> Edit --> System --> Isolation Level. When connecting commitment control gets automatically started.
      I'd suggest to run all your ACS sessions under commit!
      2. You can execute a SET TRANSACTION command at the beginning of the session to set the appropriate Isolation/Commit Level
      3. you can add the commit level at the end of each INSERT/UPDATE/DELETE Statement (Update .... WITH CS or Update .... WITH NC)

      Just starting commitment control does not yet guarantee that your SQL Statements are executed under commitment control ... and SQL performs the STRCMTCL command by itself.

      Comment


      • #4
        Thanks. I will give it a try. 99 % of my queries are just selects, but occasionally I need to update data.

        Comment

        Working...
        X