difference between temporary table and global temporary table

in ; What is the difference between temporary table and global temporary table?...
+ Post Reply + Post New Topic
Results 1 to 5 of 5
  1. #1
    harshith is offline Junior Member
    Points: 120, Level: 2
    Join Date
    07 Nov 2011
    Posts
    4
    Points
    120

    difference between temporary table and global temporary table

    What is the difference between temporary table and global temporary table?


  2. #2
    zargon's Avatar
    zargon is offline Forum Guru
    Points: 26,260, Level: 96
    Join Date
    22 Oct 2008
    Location
    Aurora, CO
    Posts
    2,015
    Points
    26,260

    Re: difference between temporary table and global temporary table

    A temporary table is owned by the person who created it and can only be accessed by that user. A global temporary table is accessible to everyone and will contain data specific to the session using it; multiple sessions can use the same global temporary table simultaneously. It is basically a global definition for a temporary table that all can benefit from.
    David Fitzjarrell
    harshith says Thanks.

  3. #3
    harshith is offline Junior Member
    Points: 120, Level: 2
    Join Date
    07 Nov 2011
    Posts
    4
    Points
    120

    Re: difference between temporary table and global temporary table

    thanks David Fitzjarrell

  4. #4
    rajavu's Avatar
    rajavu is offline Forum Guru
    Points: 10,830, Level: 68
    Join Date
    13 Oct 2008
    Location
    @ Bangalore , India
    Posts
    815
    Points
    10,830

    Re: difference between temporary table and global temporary table

    But In Oracle , temporary table is same as Global temporary table. You just cannot create a temp table without the keyword "global" in Oracle.

    Raj.

  5. #5
    zargon's Avatar
    zargon is offline Forum Guru
    Points: 26,260, Level: 96
    Join Date
    22 Oct 2008
    Location
    Aurora, CO
    Posts
    2,015
    Points
    26,260

    Re: difference between temporary table and global temporary table

    This is true but we do get questions regarding other databases and SQL Server/Sybase offer both local and global temporary tables. MySQL only offers local temporary tables.

    Since the question was not database-specific (yes, I know this is for the most part an Oracle forum) I answered generically.
    David Fitzjarrell

Other Solutions
  1. Relating to global temporary tables
    By Nagaraju in forum SQL PL/SQL
    Replies: 2
    Last Post: 03-04-2011, 07:56 AM
  2. Using one global temporary table for multiple schemas
    By Mariane in forum Oracle Database
    Replies: 1
    Last Post: 12-22-2009, 01:35 PM
  3. Global temporary tables Session issue
    By krylor in forum SQL PL/SQL
    Replies: 4
    Last Post: 04-29-2009, 05:37 PM