当前位置:网站首页>Oracle temporary table explanation
Oracle temporary table explanation
2022-07-01 00:54:00 【A brief memory of fleeting years】
One 、Oracle A temporary table
A temporary table is a special kind of table . When we need to ( It can be multiple ) When a batch of data in the table is operated repeatedly , Create a temporary table for this batch of data , May simplify operations and may improve efficiency !
Basic grammar :
create global temporary table Temporary table name (
colum,colum,.......
)
on commit delete rows;
on commit preserve rows;
explain :
- on commit delete rows; Indicates that the data row is only visible in the current transaction , It's also the default value , The data line will disappear after the transaction is committed ; A transaction level temporary table is created .
- on commit preserve rows; Indicates that data rows are visible only in the current session ; A session level temporary table is created .
Two 、 Demonstration of examples
2.1、 Transaction level temporary table
-- Create transaction level temporary tables tmp_user notes :on commit delete rows Omission
create global temporary table tmp_user (
user_id varchar2(10),
user_name varchar2(20)
) on commit delete rows;


2.2、 Session level temporary table
-- Create session level temporary tables tmp_user1
create global temporary table tmp_user1 (
user_id varchar2(10),
user_name varchar2(20)
)on commit preserve rows;


3、 ... and 、 Temporary table description
- The data of the temporary table is based on a session or a transaction , Other sessions cannot access .
- Temporary tables can be dedicated to transactions , It can also be dedicated to the session . For temporary tables dedicated to transaction processing , The data exists during the transaction ; For session specific temporary tables , Data exists during the session . In both cases , The data inserted by the session is dedicated to the session . Each session can only view and modify its own data . therefore , Data for temporary tables is never obtained DML lock

边栏推荐
- Line number of Jenkins pipeline script execution exception
- C # Generate PPK files in Putty format (passthrough support)
- 2022-2028 global capsule shell industry research and trend analysis report
- [designmode] singleton pattern
- 深度学习的历史
- A single element in an ordered array
- NE555波形发生器手把手教程之NE555内部结构(一)
- Can SQL execution be written in tidb dashboard
- 对libco的一点看法
- Using Excel to quickly generate SQL statements
猜你喜欢

Member management applet actual development 07 page Jump

2022-2028 global weight loss ginger tea industry research and trend analysis report

P4学习——Basic Tunneling

BeanUtils. Copyproperties() vs. mapstruct

剑指 Offer 18. 删除链表的节点

SAP ui5 beginner tutorial 19 - SAP ui5 data types and complex data binding

C # Generate PPK files in Putty format (passthrough support)

Authentication principle of Ranger plug-in

C # generates PPK files in putty format (supports passphrase)

优质的水泵 SolidWorks模型素材推荐,不容错过
随机推荐
CTF tool (1) -- archpr -- including installation / use process
20220215 misc buctf easycap Wireshark tracks TCP flow hidden key (use of WinHex tool)
Introduction to ES6 promise, new features of ES7 and es8 async and await
MySQL index test
Examples of topological sequences
Using Excel to quickly generate SQL statements
C language file operation for conquering C language
Redis - how to understand publishing and subscribing
2022-2028 global ICT test probe industry research and trend analysis report
Join table query select generation
给按钮的边框和文字设置不同的背景色
New trend of embedded software development: Devops
Error 2059 when Navicat connects to MySQL
ArrayList分析1-循环、扩容、版本
Get screen height
The quantity and quality of the devil's cold rice 101; Employee management; College entrance examination voluntary filling; Game architecture design
ArrayList analysis 1-cycle, capacity expansion, version
2022-2028 global carbon fiber room scraper system industry research and trend analysis report
CSDN常用复杂公式模板记录
Rhai - rust's embedded scripting engine