Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Beginner create table question
drichardson wrote:
> Hello,
>
> I am new to Oracle and I need to create a simple table, but when I attempt
> to create the table I get an invalid object (I think its object) error in
> line 3:
>
> create table SALESOUT (
> 2 Disti CHAR(50),
> 3 Date DATE,
> 4 Period NUMBER,
> 5 Sales Out NUMBER(9,2),
> 6 Bookings NUMBER(9,2),
> );
>
> Can someone look at my code and tell me if it is incorrect, I would really
> appreciate it.
>
> Thanks in advance,
>
> Dave
Dave,
'date' is reserved word in SQL :(
So you have to change column's name to something different from 'Date', like
out_date.
More comments, you cannot use space in column name the way you do this, you
must include your column in '"', e.g. "Sales Out". Note, that in such case you
will always need to refer to this object using name in '"', for instance, SQL
statement 'select salesout."Sales Out" from salesout' will be correct while
'select salesout."sales out" from salesout' NOT!
Have a luck,
I.Grinbergs
Received on Sat Nov 22 1997 - 00:00:00 CST