What is the difference between a Local temporary table and a
Global temporary table? How is each one used?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is built-in/administrator?

567


Why do you need a sql server?

497


How to populate a table in sql server?

492


Write a sql query to display the current date?

621


How to convert a table data in XML format in sql server?

2109






Is null vs coalesce?

497


Do you know what guidelines should be followed to help minimize deadlocks?

529


Do you know sql server 2008 introduces automatic auditing?

508


What is dynamic cursor in SQL SERVER?

557


How does recursive cte works in sql server?

515


What happens if we shrink log file in sql server?

509


Due to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

857


Can we run Reporting Services with SQL Server express edition, which is a free version of SQL Server?

78


What is difference between clustered index and non clustered index?

620


What is Dependency Injection and provide example?

604