Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: 'Select As' Question
I think that you have to put the a name for the table column for the to_date
selection...you can't name the table coloumn to_date(dat, 'DD MON
> YYYY HH24 MI SS')
Try this:
1 CREATE TABLE weblog
2 AS SELECT session_id, host, dat, url , to_date(dat, 'DD MON YYYY
HH24 MI SS') AS aliasname
3 FROM welo
Change aliasname to whatever you want the column name to be.
<h0444vcs_at_rz.hu-berlin.de> wrote in message
news:7la5cj$bvh$1_at_nnrp1.deja.com...
> 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 ?
>
> Many thanks for your consideration !
>
> Markus Banach
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Received on Tue Jun 29 1999 - 07:56:13 CDT