Create Temp table from view

For performance purposes I want to copy a view into a temp table before starting a SP that contains a cursor and multiple loops.

I found an example of creating the table
CREATE GLOBAL TEMPORARY TABLE my_temp_table (
  column1  NUMBER,
  column2  NUMBER
) ON COMMIT PRESERVE ROWS;

But the view has about 30 columns and I want to know if there is an easier way to do a copy besides defining every column i.e can I do something like this

CREATE GLOBAL TEMPORARY TABLE my_temp_table AS
 ( SELECT *
    FROM MY_VIEW
 )ON COMMIT PRESERVE ROWS;


Thank you
ckaleyAsked:
Who is Participating?
 
sdstuberCommented:
CREATE GLOBAL TEMPORARY TABLE my_temp_table  ON COMMIT PRESERVE ROWS
AS
  SELECT *
    FROM MY_VIEW;  
0
 
ckaleyAuthor Commented:
Thank you so much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.