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: 'Select As' Question

Re: 'Select As' Question

From: Gennaro Napolitano <Gennaro.Napolitano_at_italdata.it>
Date: Tue, 29 Jun 1999 12:38:21 +0200
Message-ID: <3778A21D.275F9B6A@italdata.it>

h0444vcs_at_rz.hu-berlin.de wrote:

> Dear Readers,
>
> I have some trouble migrating data from one table to another.
> I created first the table welo (session_id, host, dat, url),
> where dat is char(20). I imported data via sqlldr to welo.
> A typically dat field looks like :
>
> 20 MAY 1997 03 24 13
>
> So far everything went smoothly. I now want to copy table welo
> into table weblog changing dat from char to date.
>
> 1 CREATE TABLE weblog
> 2 AS SELECT session_id, host, dat, url , to_date(dat, 'DD MON
> YYYY HH24 MI SS')
> 3 FROM welo
>
> the following error message appears :
>
> CREATE TABLE weblog
> *
> ERROR at line 1:
> ORA-00998: must name this expression with a column alias
>
> Does someone of you know what went wrong ?

I think you need to name the result of the to_date expression; try this;

1 CREATE TABLE weblog
 2 AS SELECT session_id, host, to_date(dat, 'DD MON YYYY HH24 MI SS') dat, url
 3 FROM welo

Hope this help

Ciao Received on Tue Jun 29 1999 - 05:38:21 CDT

Original text of this message

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