Oracle Tutorial

What is Oracle
SQL Keywords

Oracle Wildcards

Oracle Wildcards

Oracle Aliases

Oracle Aliases

MySQL Tutorial

MySQL Tutorial

PL/SQL Tutorial

PL/SQL Tutorial

Oracle Interview Questions

Oracle Interview Questions and Answers


Oracle COMMIT Statement

In Oracle, COMMIT statement is used to commits all changes into the database table for the current transaction. Once committed, the committed changes is than available for other users.

Oracle COMMIT Statement Syntax

To commits all changes into the database table, use the following syntax:

Syntax

COMMIT [ WORK ] [ COMMENT clause ] [ WRITE clause ] [ FORCE clause ];

Parameters:

WORK: COMMIT with or without the WORK parameter will result in the same outcome.

COMMENT: This is optional. It is used to specify a comment to be associated with the current transaction.

WRITE : It is used to specify the priority that the redo information for the committed transaction is to be written to the redo log.

FORCE : It is used to force the commit of a transaction that may be corrupt or in doubt.

Oracle COMMIT Statement examples

The following Oracle statement to issue a commit in Oracle using the COMMIT statement:

Example

COMMIT;

OR

COMMIT WORK WRITE WAIT IMMEDIATE;

Note:

In the above example shows that how to issue a commit in Oracle using the COMMIT statement.

Oracle COMMIT Comment examples

The following Oracle statement shows that how to use the COMMENT clause, both of these COMMIT examples are equivalent:

Example

COMMIT COMMENT 'Write comment for the transaction';

OR

COMMIT WORK COMMENT 'Write comment for the transaction';

Note:

In the above example shows that how to use the COMMENT clause with COMMIT.