Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Create table question
<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