4
4
COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
6
6
Calling COMMIT will cause the current transaction to save itself.
8
A COMMIT statement ends a transaction within Drizzle and makes all
9
changes visible to other users. The order of events is typically to
10
issue a START TRANSACTION statement, execute one or more SQL
11
statements, and then issue a COMMIT statement. Alternatively, a
12
ROLLBACK statement can be issued, which undoes all the work performed
13
since START TRANSACTION was issued. A COMMIT statement will also
14
release any existing savepoints that may be in use.
16
For example, DML statements do not implicitly commit the current
17
transaction. If a user's DML statements have been used to update some
18
data objects, and the updates need to be permanently recorded in the
19
database, you can use the COMMIT command.
27
INSERT INTO popular_sites (url, id)
28
VALUES ('flickr.com', 07);
30
INSERT INTO popular_sites (url, id)
31
VALUES ('twitter.com', 10);
33
SELECT * FROM popular_sites;
35
+-----+---------------+-------+---------------------+
36
| id | url | notes | accessed |
37
+=====+===============+=======+=====================+
38
| 07 | flickr.com | NULL | 2011-02-03 08:33:31 |
39
+-----+---------------+-------+---------------------+
40
| 10 | twitter.com | NULL | 2011-02-03 08:39:16 |
41
+-----+---------------+-------+---------------------+
43
Then to save the information just inserted, simply issue the COMMIT command: