临时表存储在用户临时表空间中。
考虑使用表变量来代替临时表。
例1:创建引用临时表的过程。
Example 1: Building a procedure which references a temporary table.
临时表在进行引用之前必须先声明。
Temporary tables must be declared before they can be referenced. The following SQL procedure (created from the command line) demonstrates the process.
创建数据库时不存在用户临时表空间。
No user temporary table Spaces exist when a database is created.
使用过程来删除临时表有以下两个优点
Using a procedure to drop the temporary table has these two benefits
扩展的索引或声明的临时表。
然后创建了引用临时表的过程p1。
Then a procedure p1 was created which references the temporary table.
清单9展示了一个已声明临时表的示例。
完成了通过存储过程声明临时表的封装。
It completes the encapsulation of the temporary table declaration through stored procedures.
没有创建用户临时表空间。
创建一个用作全局临时表的用户表空间。
Create a user temporary table space for use by the global temporary table.
运行close_temp删除临时表。
向临时表填充三行记录。
——临时表空间,tempspace1。
临时表空间可以是系统的,也可以是用户的。
最好从系统临时表空间创建用户临时表空间。
It is best to create user temporary table space from the system one.
清单7给出了与临时表创建有关的统计信息。
Listing 7 shows the statistics associated with temporary-table creation.
Tempspace1——存储系统临时表。
已声明的全局临时表上的runstats。
所消耗的用户临时表空间中的空间将得到释放。
The consumed space in the user temporary table space will be freed.
应用程序编程改进:临时表和版本控制。
Application programming improvements: Temporal tables and versioning.
定义在声明的全局临时表上的索引不能被转移。
Indexes defined on a declared global temporary table cannot be transferred.
使用过程来初始化临时表可带来三个主要优点。
Using a procedure to initialize the temporary table yields three key benefits.
表变量、会话与临时表。
每个数据库必须至少有一个系统临时表空间。
数据库中定义了五个常规的表空间和一个临时表空间。
In the database, five regular tablespaces and one temporary tablespace are defined. The following table shows the details of all tablespaces.
对于经常用于执行排序操作的临时表空间,也应该这样。
The same is true for temporary tablespaces often used for performing sort operations.
应用推荐