Global temporary table

Database

Global temporary table

How to create a GTT from another table

is it like

create global temporary table as
(sel * from employee)
on commit preserve row;

if i do this, the syntax error: something expected between ')' and 'on'

what is the mistake?
1 REPLY
N/A

Re: Global temporary table

create global temporary table t1 as
(sel * from employee)
WITH NO DATA --------------------------
on commit preserve row;

Are you sure you want a Global table, not a volatile?
If the definition of Employee changes, you get the definition of employee as it was when the global temporary definition was created, not as it is now.