Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sql wrong? missing left parenthesis error?

Re: sql wrong? missing left parenthesis error?

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 18 Nov 2002 18:51:17 GMT
Message-ID: <3DD9369F.CD4CCE41@exesolutions.com>


Sandy wrote:

> I can't see anything wrong with this sql statement but SQL*Plus
> doesn't seem to like it. Anyone else see something wrong?
>
> *****************************
> SQL> ed
> Wrote file afiedt.buf
>
> 1 CREATE TABLE kodUserSession (
> 2 SessionID
> 3 UserID
> 4 foreign key User
> 5 LogonStamp
> 6 LogoffStamp
> 7 IPAddress
> 8 constraint kodUserSession_PK PRI
> 9 )
> 10* tablespace KOD_DATA
> 11 /
> foreign key User
> *
> ERROR at line 4:
> ORA-00906: missing left parenthesis
> *******************************************************

You need to get a very basic book on Oracle and its syntax. There are more things incorrect with the above than there are correct. Here's by quick list.

  1. No data types
  2. No data sizes/lengths
  3. No data precision is any are numeric
  4. No commas after field names
  5. No pctfree or pctused
  6. No storage parameters (initial, next, pctfree, freelists)
  7. This is no way to define a primary key constraint. Define it in an alter table statement and define its columns, tablespace, pctfree, and storage parameters.

Acquaint yourself with http://tahiti.oracle.com

Daniel Morgan Received on Mon Nov 18 2002 - 12:51:17 CST

Original text of this message

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