In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to create and use temporary tables in Oracle. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
ORACLE database can not only save permanent table, but also create temporary table temporary tables. These temporary tables are used to hold data for a session SESSION or data needed in a transaction. When the session exits or the user commits the commit and rolls back the rollback transaction, the data of the temporary table is automatically emptied, but the structure of the temporary table and metadata are also stored in the user's data dictionary.
Classification:
1. Session-level temporary table
Session-level temporary table means that the data in the temporary table only exists in the session life cycle. When the user exits and the session ends, Oracle automatically clears the temporary table data.
Format:
Create Global Temporary Table Table_Name
(
Col1 Type1
Col2 Type2
...
)
On Commit Delete Rows
When a transaction ends (commit or rollback), Oracle automatically clears the data in the temporary table.
The following demonstrates the creation and use of temporary tables in Oracle 10g:
1. Create a transaction-level temporary table, insert a piece of data, and query:
Create global temporary table session_temp_tb (col1 varchar (20)) on commit preserve rows
Insert into session_temp_tb values ('test')
Select * from session_temp_tb
4.。 Perform commit or rollback operations, and the data in the table still exists. Create a new command window (equivalent to opening a new session), and the data in the table cannot be queried:
5. If the session that created the session temporary table did not end, you cannot delete the temporary table because the temporary table is still in use, but you can delete it after you end the session (close the command window that creates the session-level temporary table):
On how to create and use temporary tables in Oracle to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 249
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.