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: Create table question

Re: Create table question

From: Anurag Varma <avdbi_at_gmail.com>
Date: Fri, 21 Jan 2005 00:47:42 GMT
Message-ID: <OiYHd.155772$Uf.128224@twister.nyroc.rr.com>

<peteg_at_garlic.com> wrote in message
news:1106251978.044376.7920_at_z14g2000cwz.googlegroups.com...
> Malcolm Dew-Jones wrote:
> >
> > Note the length from the rpad, and the type from dummy, and the value
> from
> > the literal 'OK'.
> >
> > There is probably a prettier way if you play with some other
> functions,
> > but I hope you get the idea.
> >
> > --
> >
> > This space not for rent.
>
> Malcolm,
>
> This works like a charm. You're right, it's not the most elegant way
> imaginable, but it does do the trick.
>
> Thanks,
>
> Pete
>

A more elegant way would probably be:

ORA92> create table xyz1 as select xyz.*, cast('OK' as varchar2(10)) d from xyz;

Table created.

ORA92> desc xyz1

 Name                                      Null?    Type
 ----------------------------------------- -------- ------------------------
----
 A                                         NOT NULL NUMBER
 B                                                  NUMBER
 C                                                  NUMBER
 D                                                  VARCHAR2(10)


Anurag Received on Thu Jan 20 2005 - 18:47:42 CST

Original text of this message

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