H2 Database Tutorial
H2 Database - Data Manipulation
H2 Database - Data Definition
H2 Database Useful Resources
Selected Reading
H2 Database - Data Manipulation
- H2 Database - Show
- H2 Database - Merge
- H2 Database - Explain
- H2 Database - Call
- H2 Database - Backup
- H2 Database - Delete
- H2 Database - Update
- H2 Database - Insert
- H2 Database - Select
H2 Database - Data Definition
- H2 Database - JDBC Connection
- H2 Database - Rollback
- H2 Database - Savepoint
- H2 Database - Grant
- H2 Database - Commit
- H2 Database - Truncate
- H2 Database - Drop
- H2 Database - Alter
- H2 Database - Create
H2 Database Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
H2 Database - Commit
H2 Database - Commit
COMMIT is a command from the SQL grammar used to commit the transaction. We can either commit the specific transaction or we can commit the currently executed transaction.
Syntax
There are two different syntaxes for COMMIT command.
Following is the generic syntax for the commit command to commit the current transaction.
COMMIT [ WORK ]
Following is the generic syntax for the commit command to commit the specific transaction.
COMMIT TRANSACTION transactionName
Example 1
In this example, let us commit the current transaction using the following command.
COMMIT
The above command produces the following output.
Committed successfully
Example 2
In this example, we will commit the transaction named tx_test using the following command.
COMMIT TRANSACTION tx_test;
The above command produces the following output.
Committed successfullyAdvertisements