Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create a temporary table and insert it with a select statement

694011Apr 2 2009 — edited Apr 2 2009
Hi 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
This post has been answered by 21205 on Apr 2 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2009
Added on Apr 2 2009
10 comments
11,218 views