当前位置:网站首页>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
边栏推荐
- Two-stage RO: part 1
- 问题解决:如何管理线程私有(thread_local)的指针变量
- 2022-2028 global PTFE lined valve industry research and trend analysis report
- Interface documentation system - Yapi
- Excuse me, does Flink support synchronizing data to sqlserver
- Can JDBC based on openjdk connect to MySQL?
- Exercise and health
- 2022-2028 global rotary transmission system industry research and trend analysis report
- 2022-2028 global carbon fiber room scraper system industry research and trend analysis report
- CSDN常用复杂公式模板记录
猜你喜欢
HDU 2488 A Knight's Journey(DFS)
Sword finger offer 19 Regular Expression Matching
Line number of Jenkins pipeline script execution exception
Sword finger offer 18 Delete the node of the linked list
【原创】 PLSQL 索引排序优化
Member management applet actual development 07 page Jump
20220216 misc buuctf backdoor killing (d shield scanning) - clues in the packet (Base64 to image)
CentOS installation starts redis
left join左连接匹配数据为NULL时显示指定值
C # Generate PPK files in Putty format (passthrough support)
随机推荐
What SQL statements are supported for data filtering
2022-2028 global ethylene oxide scrubber industry research and trend analysis report
Can SQL execution be written in tidb dashboard
Vulnerability discovery - App application vulnerability probe type utilization and repair
2022-2028 global ICT test probe industry research and trend analysis report
魔王冷饭||#101 魔王解惑数量多与质量;员工管理;高考志愿填报;游戏架构设计
Pytorch auto derivation
20220216 misc buuctf backdoor killing (d shield scanning) - clues in the packet (Base64 to image)
Self examination before school starts
Random ball size, random motion collision
Thoughts on the future of data analysis in "miscellaneous talk"
Plot size and resolution with R markdown, knitr, pandoc, beamer
Ditto set global paste only text shortcuts
Some views on libco
P4学习——Basic Tunneling
Excuse me, does Flink support synchronizing data to sqlserver
问题解决:如何管理线程私有(thread_local)的指针变量
$watch will not trigger data change - $watch not firing on data change
Redis - how to understand publishing and subscribing
2022-2028 global elevator emergency communication system industry research and trend analysis report