You are viewing an older version of this section. View current production version.
Commits the open transaction if one exists.
COMMIT [ WORK ] [ AND [ NO ] CHAIN ] [ [ NO ] RELEASE ]
[ AND [ NO ] CHAIN ]and
[ [ NO ] RELEASE ]are ignored as these options are not currently supported by MemSQL.
- This command must be run on the master aggregator or a child aggregator node (see Node Requirements for MemSQL Commands.
- If the transaction is unsuccessful or needs to be reverted, then execute the ROLLBACK command.
For this example, consider the following
BEGIN; UPDATE Employee SET Name = "Jim" WHERE ID = 30;
SELECT query to verify if the
UPDATE is correct:
SELECT * FROM Employee; **** +------+-------+ | ID | Name | +------+-------+ | 30 | Jim | | 20 | Rob | | 40 | Rick | +------+-------+
COMMIT since the
UPDATE was successful.
Note: Before the user runs
ROLLBACK, only that user can see the updates made after the BEGIN statement was run.