Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8807269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:19:44+00:00 2026-06-14T02:19:44+00:00

I created a global temp table using the following DDL: CREATE GLOBAL TEMPORARY TABLE

  • 0

I created a global temp table using the following DDL:

CREATE GLOBAL TEMPORARY TABLE MY_TEMP_TABLE 
(
  column1  NUMBER,
  column2  NUMBER
)  ON COMMIT PRESERVE ROWS 

Then I put some data into it and can read it fine.

I close my SQL client session and reopened it and the table is still there but has no data.

Am I correct in my observation that global temp tables persist between sessions just like regular permanent tables yet the data within them is lived only as long as the session in which it is populated?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:19:46+00:00Added an answer on June 14, 2026 at 2:19 am

    Correct.

    A global temporary table exists forever, just like any other database object. It is created when you install your application (not at runtime) just like any other database object.

    If you specify ON COMMIT PRESERVE ROWS, the data persists for the lifetime of the session (and is only visible to the session that inserted it). If you specify ON COMMIT DELETE ROWS, the data persists only for the lifetime of the transaction (and is only visible to the transaction that inserted it).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Oracle, you can create a temp table using something like: CREATE GLOBAL TEMPORARY
I have a string like following: CREATE GLOBAL TEMPORARY TABLE some_temp_table_name or CREATE GLOBAL
I have a sample file like the following: CREATE GLOBAL TEMPORARY TABLE tt_temp_user_11 (
Suppose I'm using the following Oracle code in a stored procedure: CREATE GLOBAL TEMPORARY
I created the global temp table. when I execute the code as an individual
I have a global temp table which is set as delete on commit. How
I am using my admin panel login script where i have created a global.php
I created a following class within a namespace Global namespace Global { public static
I want to create temporary table in stored procedure and access it in the
I have optimized a complex Oracle statement using temporary table like this : original

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.