Use the COMMIT statement to commit a transaction.
Before you commit a transaction:
Your modifications are visible only to the current session and invisible to other database sessions.
Your modifications are not persistent. You can use the
ROLLBACKstatement to undo them.
After you commit a transaction:
Your changes are visible to all database sessions.
Your modifications are persisted into the database. You cannot use the
ROLLBACKstatement to undo them.
Example:
obclient> INSERT INTO t_insert(id,name) VALUES(4,'JP');
Query OK, 1 row affected (0.01 sec)
obclient> COMMIT;
Query OK, 0 rows affected (0.00 sec)
obclient> EXIT;
Bye
[user@host ~]$obclient -h10.10.10.1 -u******@obbmsql#obdemo -P2883 -p**1*** TPCC
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient> SELECT * FROM t_insert;
+----+------+-------+---------------------+
| ID | NAME | VALUE | GMT_CREATE |
+----+------+-------+---------------------+
| 1 | CN | 10001 | 2020-04-02 17:52:31 |
| 2 | US | 10002 | 2020-04-02 17:52:38 |
| 3 | EN | 10003 | 2020-04-02 17:52:38 |
| 4 | JP | NULL | 2020-04-02 17:53:34 |
+----+------+-------+---------------------+
4 rows in set (0.00 sec)
For more information about transaction control statements, see About transaction control statements.