Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Copying the structure

Re: Copying the structure

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Tue, 25 Apr 2006 07:14:28 +0200
Message-ID: <444db033$0$27280$626a54ce@news.free.fr>

<pankaj_wolfhunter_at_yahoo.co.in> a écrit dans le message de news: 1145940718.499857.315340_at_t31g2000cwb.googlegroups.com...
| Greetings,
| I have a table as
| table1
| ID INTEGER
| NAME VARCHAR2(50)
| DOJ TIMESTAMP
| .....
|
| I want to create another table (table2) with the same structure as
| table1 but the DOJ
| datatype has to be changed to NUMBER(5,4)
|
| table2
| ID INTEGER
| NAME VARCHAR2(50)
| DOJ NUMBER(5,4)
| ....
|
| Can I do it in single select statement? Something related to
|
| CREATE TABLE table2 AS SELECT * FROM table1 WHERE 1=0;
|
| Any help would be appreciated?
|
| TIA
|

something like:

CTAS select id, name, to_number(to_char(doj,'DDD')) doj from table1 where 1=0;

Regards
Michel Cadot Received on Tue Apr 25 2006 - 00:14:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US