What does COMMIT do?

please, I want to understand the difference between the following statements:

insert into table_name values (,,,,,);

and

insert into table_name values (,,,,,);
commit;
+4
source share
2 answers

If you insert data without committing, you can select data from the database and see it. But other users cannot.

Better look at the sql documentation:

Until you complete the transaction:

You can see any changes you made during the transaction, requesting the changed tables, but other users cannot see the changes. After the transaction, the changes are visible to others that are performed after the commit.

You can undo (undo) any changes made during a transaction using the ROLLBACK statement (see ROLLBACK.

, Oracle

+6

DML (, , ) , , , , . DML, .

?

Docs.oracle

Use the COMMIT statement to end your current transaction and make
permanent all changes performed in the transaction. A transaction is a
sequence of SQL statements that Oracle Database treats as a single unit. 
his statement also erases all savepoints in the transaction and releases
transaction locks.
+1

All Articles