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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: about CTAS and column definition

RE: about CTAS and column definition

From: NGUYEN Philippe (Cetelem) <philippe.nguyen_at_cetelem.fr>
Date: Wed, 27 Apr 2005 17:31:03 +0200
Message-ID: <ABDF0B66BB2D194FBA86112DA70C5FC1515EFC@ngmail3.ctlmcofnt.ms.fr.cnet.intra>


thanks Tom
so it is not possible to do this in one shut ?

> ____________________________________________________
> Philippe Nguyen
> CETELEM - Administration, Architecture Décisionnelle
> Direction Customer Relationship Management
> E-Mail : philippe.nguyen_at_cetelem.fr
> Tel : (+33) 1 46 39 92 16 - Fax : (+33) 1 46 39 59 88
>

-----Message d'origine-----
De : Mercadante, Thomas F (LABOR)
[mailto:thomas.mercadante_at_labor.state.ny.us] Envoyé : mercredi 27 avril 2005 17:27
À : 'philippe.nguyen_at_cetelem.fr'; oracle-l Objet : RE: about CTAS and column definition

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_at_cetelem.fr] 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

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

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Apr 27 2005 - 11:37:15 CDT

Original text of this message

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