Home > database >  Temporary tables in the Oracle
Temporary tables in the Oracle

Time:09-20

The temporary table problem in oracle
Generally we all use
The create global temporary table to establish
But there is option one
Create a local temporary table
I don't have the product description,
Want to understand the difference between the local and global, online, and say that there is no difference,
If there is no difference, why will establish two different options,
If the table space that also strange,
For the exact explanation

CodePudding user response:

Where the local temporary table

CodePudding user response:

Local seems to not create, but declare, this may be used in stored procedures, functions, such as in the pl/SQL code used to handle temporary data, processed and the different code should also won't affect each other, estimated also exist in the current script

CodePudding user response:

In fact, oracle and no local temporary type of temporary table,

Consider the type with pipeline function to realize the memory table, speed or can be,

CodePudding user response:

1. Begin from Oracle 18 c, provides the GLOBAL TEMPORARY TABLE outside another option: PRIVATE TEMPORARY TABLE ,

2. This kind of private temporary table and global temporary tables are a few differences: private temporary table at the end of the transaction (transaction) or (session) at the end of the session is deleted, table and data will be deleted; They are stored in memory, the table definitions and data are visible only to the current session; SYS user cannot create private temporary table,

3. There are some restrictions on the use, such as begins with a specific prefix, the default is $PTT_ ORA, can refer to the Oracle documentation: https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/CREATE-TABLE.html#GUID-F9CE0CC3-13AE-4744-A43C-EAC7A71AAAB6

In addition, PostgreSQL is spelled [GLOBAL | LOCAL] TEMPORARY TABLE, but these two kinds of writing is no different from,

CodePudding user response:

The temporary table, or use with,
  • Related