当前位置:网站首页>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

边栏推荐
- Error msb8031: building an MFC project for a non Unicode character set is deprecated
- Date类的实现
- Stack frame
- ArrayList analysis 1-cycle, capacity expansion, version
- Ybtoj exchange game [tree chain splitting, line segment tree merging]
- 2022-2028 global herbal diet tea industry research and trend analysis report
- The programmer's girlfriend gave me a fatigue driving test
- On the application of cluster analysis in work
- CentOS installation starts redis
- Member management applet actual development 07 page Jump
猜你喜欢

Two-stage RO: part 1

20220215-ctf-misc-buuctf-ningen--binwalk analysis --dd command separation --archpr brute force cracking

Wechat official account development (1) introduction to wechat official account

C language file operation for conquering C language

2022-2028 global elevator emergency communication system industry research and trend analysis report

Mindjet mindmanager2022 mind map decompression installer tutorial

Authentication principle of Ranger plug-in

魔王冷饭||#101 魔王解惑数量多与质量;员工管理;高考志愿填报;游戏架构设计

2022-2028 global mobile scanning radiology room industry survey and trend analysis report

Host FL Studio fruit music production daw20.9
随机推荐
New trend of embedded software development: Devops
【日常记录】——对BigDecimal除法运算时遇到的Bug
Bugku CTF daily one question dark cloud invitation code
Tide - rust web framework based on async STD
Rust book materials - yazhijia Library
Pytorch installs and uses GPU acceleration
Integer to hexadecimal string PTA
合适的工作就是好工作
Basic knowledge of Embedded Network - introduction of mqtt
MySQL variables, stored procedures and functions
P4学习——Basic Tunneling
女朋友说:你要搞懂了MySQL三大日志,我就让你嘿嘿嘿!
What SQL statements are supported for data filtering
20220216 misc buuctf another world WinHex, ASCII conversion flag zip file extraction and repair if you give me three days of brightness zip to rar, Morse code waveform conversion mysterious tornado br
On the application of cluster analysis in work
Exercise and health
Sword finger offer 18 Delete the node of the linked list
Line number of Jenkins pipeline script execution exception
Cloud security daily 220630: the IBM data protection platform has found an arbitrary code execution vulnerability, which needs to be upgraded as soon as possible
初识 Flutter 的绘图组件 — CustomPaint