Skip to Main Content
  • Questions
  • Understanding purpose of undo for Global Temporary Tables DML operation

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, SanthoshKumar.

Asked: June 20, 2020 - 5:48 am UTC

Last updated: July 01, 2020 - 1:58 am UTC

Version: 11.2

Viewed 1000+ times

You Asked

Hi TOM,
I know Global Temporary Table (GTT) will generate undo data while any DML operations performed on it within that session before commit. But I want to understand why undo is needed for DML operations on GTT. Is that to support following kind of time based queries within that session?

SELECT * FROM GTT_TAB1 AS OF TIMESTAMP TO_TIMESTAMP('2005-04-04 09:30:00', 'YYYY-MM-DD HH:MI:SS');

and Connor said...

Far simpler than that....We need to allow this:

insert into GTT values (1);
rollback;                                  <<=====


For that...you need undo.


Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thank You!

Santhosh, June 30, 2020 - 4:47 am UTC

Thanks You! for reviewing it. I understood it better now.
Connor McDonald
July 01, 2020 - 1:58 am UTC

glad we could help

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library