Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Creating empty temp table from an existing view
I am looking for a generic approach to create an empty temp table
matching the definition of given columns of existing view.
To do that I use SQL like the following:
CREATE GLOBAL TEMPORARY TABLE MY_TEMP_TABLE AS SELECT COLUMN_1, COLUMN_2 FROM MY_VIEW WHERE 1 = 2 The problem I face is that this approach appears to be too costly because according to explain plan ORACLE scans indexes of all the tables composing the view despite the fact that WHERE clause constantly false and no rows should be returned.
Is there a better and faster approach? One condition: the solution should be fairly generic, with only known factors being column names and view name. Received on Wed Sep 28 2005 - 09:16:52 CDT
![]() |
![]() |