Oracle creates temporary tables

Source: Internet
Author: User

Temporary tables in Oracle can be divided into session-level temporary tables and transaction-level temporary tables.

The role of temporary tables: for large amounts of data we just need to query a subset of the result sets so that we can use temporal tables.

1. Session-Level staging table

A session-level temporary table is the data in a staging table that exists only during the session lifecycle, and when the user exits the end of the session, Oracle automatically clears the data from the staging table.

Create global temporary table AAA (ID number) on commit oreserve rows;

Insert into AAA values (100);

SELECT * from AAA;

This is when you open another session window to query again, the data in the table can not be queried.

2. Temporary tables at the transaction level

Create Global temporary table BBB (ID number) on commit delete rows;

INSERT into BBB values (200);

SELECT * from BBB;

When you perform a commit and rollback operation, the data in the table is not checked again.

Oracle creates temporary tables

Related Article

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.