DDL, DML not all SQL can be automatically rolled back

Source: Internet
Author: User

DDL cannot be rolled back because the DDL is not transactional.

To implement automatic rollback. (Begin,commit,rollback), only DML is included in the SQL statement.

In this way, automated publishing is restricted to the canonical format.

Therefore, one-size-fits-all approach is to assume that all SQL does not support transactions, self-defined rollback SQL scripts, and can be rolled back with code in the case of an error.

Rather than relying on the functionality of the database itself.

========================

DDL and DML
DDL (data definition Language)
CREATE table creating tables    ALTER TABLE  modify tables   drop table Delete tables   TRUNCATE TABLE delete all rows in tables    CREATE index   drop Index  Delete Index when executing a DDL statement, Oracle commits the current transaction before and after each statement. If the user inserts a record into the database using the Insert command, a DDL statement (such as CREATE table) executes, and the data from the Insert command is committed to the database. When the DDL statement execution completes, the DDL statement is automatically committed and cannot be rolled back.
DML (data manipulation Language) Insert records inserted into database update modify database record delete delete database records when the Execute DML command is not committed, it will not be seen by other sessions. Unless a DDL command or DCL command is executed after the DML command, or the user exits the session or terminates the instance, a commit command is automatically issued to make the uncommitted DML command commit.

DDL, DML not all SQL can be automatically rolled back

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.