Indexes on temp tables
Likely this is expected behavior - can anyone confirm? I am trying to create an index on a temp table and can only do so before I load it up - not afterwards as below
SQL> CREATE GLOBAL TEMPORARY TABLE PS_PERSONAL_DATA_TEMP ON COMMIT PRESERVE ROWS as SELECT * FROM PS_PERSONAL_DATA WHERE 1=2;
Table created.
Elapsed: 00:00:00.03
SQL> INSERT INTO PS_PERSONAL_DATA_TEMP SELECT * FROM PS_PERSONAL_DATA;
206989 rows created.
Elapsed: 00:00:11.04
SQL>
SQL>
SQL>
SQL> CREATE INDEX PS_PERSONAL_DATA_TEMP ON PS_PERSONAL_DATA_TEMP (EMPLID);
CREATE INDEX PS_PERSONAL_DATA_TEMP ON PS_PERSONAL_DATA_TEMP (EMPLID)
*
ERROR at line 1:
ORA-14452: attempt to create, alter or drop an index on temporary table already in use
Elapsed: 00:00:01.01
SQL>
I'm stmontgo and I approve of this message