1 Replies - 2566 Views - Last Post: 05 June 2012 - 04:43 AM

#1 Ace1stCav  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 06-July 10

Novice level question about SQL

Posted 06 April 2012 - 01:51 PM

Hey guys...I'm having some trouble figuring out why I can't create a simple Oracle10g table. I've tried all different spacing and syntax, but I keep getting the same error ( ERROR at line 1: missing right parenthesis).I know its not case sensitive etc...I've gone over this a thousand different ways. I'm sure it's something completely simple too. Can you guys please provide some feedback?


SQL> CREATE TABLE customers(acct_id VARCHAR2(10)PRIMARYKEY,
  2  name VARCHAR2(30)NOTNULL,
  3  zip_code CHAR(5)UNIQUE);
CREATE TABLE customers(acct_id VARCHAR2(10)PRIMARYKEY,
                                           *
ERROR at line 1:
ORA-00907: missing right parenthesis


Is This A Good Question/Topic? 0
  • +

Replies To: Novice level question about SQL

#2 Nidhesh  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 9
  • Joined: 10-June 10

Re: Novice level question about SQL

Posted 05 June 2012 - 04:43 AM

Please remove the 4rth line from your code. It's a repeat of the first line.
If you were trying to add a primary constraint to the first column, you have already done that using PRIMARYKEY keyword in the first colum.
Rest look ok.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1