What is the difference between a Local temporary table and a
Global temporary table? How is each one used?
Answers were Sorted based on User's Feedback
A local temporary table exists only for the duration of a
connection or, if defined inside a compound statement, for
the duration of the compound statement.
A global temporary table remains in the database
permanently, but the rows exist only within a given
connection. When connection is closed, the data in the
global temporary table disappears. However, the table
definition remains with the database for access when
database is opened next time.
| Is This Answer Correct ? | 17 Yes | 9 No |
Answer / tarun kumnar basak
A Local Temporary table is almost the same as the Temporary
table in oracle. The main difference is that in oracle
you've to specify the keyword local in your query and also
Local Temporary table exists only for the user who is
created the table. So no other session can use/see the
temporary table.
Where as GTT is another kind of temporary table in oracle
which is by default the temporary table(if you don't
specify the keyword local). GTT can be used by every
user/schema which is connected to the DB irrespective of
each others session and without knowing what data resides
for a particular user. As soon as you log off from the
server the GTT also deleted. It is more kind of session
specific where the structure of the table is shared among
all users but not the data. Data remains private for each
users session and no Lock can be aquired on the table.
| Is This Answer Correct ? | 5 Yes | 3 No |
How to optimize stored procedure optimization?
How do you run a trace?
Explain contrast amongst grouped and non-bunched records?
Can primary key be null?
Please explain the characteristics of a transaction server for example atomicity, consistency, isolation, durability?
What is set nocount on?
What is etl - extraction, transformation, and loading?
What are the advantages dts has over bcp?
Why should one not prefix user stored procedures with ‘sp_’?
Other than truncate statement, which other command can by-pass the trigger on the tables?
How to select top 5 coloumn from a table without using coloumn name
wt is mean by acid property? i know it is atomocity,consistency,isolation and durabulaty but wt is these mean and wt actions it's perform
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)