Create a temporary table and insert it with a select statement
694011Apr 2 2009 — edited Apr 2 2009Hi there,
I tried to create a temp table and insert it with the value from select statement. Please see below code
---
CREATE GLOBAL TEMPORARY TABLE Temp_Test
(
DAY_FUTURE DATE
)
AS
SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY')
FROM DUAL CONNECT BY ROWNUM <= 14)
---
After I executed the script, error message shows the below:
--
Error starting at line 1 in command:
CREATE GLOBAL TEMPORARY TABLE Temp_Test
(
DAY_FUTURE DATE
)
AS select TO_DATE(sysdate+rownum, 'DD-MON-YY')
from dual connect by rownum <= 14)
Error at Command Line:2 Column:1
Error report:
SQL Error: ORA-01773: may not specify column datatypes in this CREATE TABLE
01773. 00000 - "may not specify column datatypes in this CREATE TABLE"
*Cause:
*Action:
--
What seems the problem? I already put the data type as TO_DATE on my select statement.
Any help would be appreciated
Thanks