RE: about CTAS and column definition

  • From: "Mercadante, Thomas F (LABOR)" <thomas.mercadante@xxxxxxxxxxxxxxxxx>
  • To: "'philippe.nguyen@xxxxxxxxxx'" <philippe.nguyen@xxxxxxxxxx>, oracle-l <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 27 Apr 2005 11:26:55 -0400

Philippe,

You can do it this way:

create table B as select sum(ctas.numcli) as numcli from A where rownum < 1;
alter table b modify(numcli number(3));
insert into b as select sum(ctas.numcli) from a;


Tom

-----Original Message-----
From: NGUYEN Philippe (Cetelem) [mailto:philippe.nguyen@xxxxxxxxxx] 
Sent: Wednesday, April 27, 2005 11:09 AM
To: oracle-l
Subject: about CTAS and column definition

Hi list,
just a little problem :

SQL> desc A
Name   Type      Nullable Default Comments 
------ --------- -------- ------- -------- 
NUMCLI NUMBER(3) Y         

SQL> create table B as select sum(ctas.numcli) as numcli from A;

Table created

SQL> desc ctas3
Name   Type   Nullable Default Comments 
------ ------ -------- ------- -------- 
NUMCLI NUMBER Y            


In table B, how can I make column numcli have number(3) type not just number
column definition using "Create Table As Select" method ? Is it possible ?

TIA
Philippe


--
//www.freelists.org/webpage/oracle-l
--
//www.freelists.org/webpage/oracle-l

Other related posts: