全局临时表中数据的持续时间? [英] Duration of data in a Global Temporary table?
本文介绍了全局临时表中数据的持续时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谁能告诉我:全局临时表中的数据会保留多长时间?
Can someone please tell me: how long will data be there in a Global Temporary table?
推荐答案
它们可以是基于 SESSION 的(数据在提交后仍然存在,但在断开/重新连接时不会存在).它们也可以基于 TRANSACTION(提交后数据消失).
They can be SESSION based (data survives a commit but not a disconnect/reconnect). They can also be TRANSACTION based (data disappears after a commit).
这将创建一个基于事务的临时表:
This creates a transaction based temp table:
create global temporary table temp_table_transaction on commit delete rows ...
这将创建一个基于会话的临时表:
This creates a session based temp table:
create global temporary table temp_table_transaction on commit preserve rows ...
这篇关于全局临时表中数据的持续时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文