Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2015
    Posts
    2

    Unanswered: No right parenthesis

    This may be a common question, but for some reason I can't seem to get similar responses from older questions on here to help me out. I am trying to figure out why, whenever I create a table... it says something about missing a right parenthesis. If anyone could help me out, that would be great. I am running into this issue with any table I try to create for schoolwork.

    SQL Error: ORA-00907: missing right parenthesis
    00907. 00000 - "missing right parenthesis"

    It is for this code. I tried adding in comma's, deleting comma's, etc.

    CREATE TABLE EMPLOYEE(
    EmployeeID Int NOT NULL IDENTITY(1,1),
    LastName Char(25) NOT NULL,
    FirstName Char(25) NOT NULL,
    Department Char(35) NOT NULL,
    Phone Char(12) NOT NULL,
    Fax Char(12) NOT NULL,
    EmailAddress VarChar(100) NOT NULL,
    CONSTRAINT EMPLOYEE_PK PRIMARY KEY(EmployeeID)
    );

  2. #2
    Join Date
    Apr 2015
    Posts
    2

    No Right Parenthesis. Oracle SQL Developer

    I tried looking for similar answers to this question, since it's common. However, I can't seem to fit those into my particular case as I'm having trouble comprehending it. I am taking a database class online for school and don't have an instructor to help me with anything. I tried adding comma's, deleting comma's, etc., but I can't quite figure out what I am doing wrong. I was able to skate by on a "completion" credit for the last project. This project however is graded, so I have to make sure I know the format to correctly create my tables. If any of you could show me what I am doing wrong, that would be great.

    Here is the error:
    SQL Error: ORA-00907: missing right parenthesis
    00907. 00000 - "missing right parenthesis"

    Here is my code:
    CREATE TABLE EMPLOYEE(
    EmployeeID Int NOT NULL IDENTITY(1,1),
    LastName Char(25) NOT NULL,
    FirstName Char(25) NOT NULL,
    Department Char(35) NOT NULL,
    Phone Char(12) NOT NULL,
    Fax Char(12) NOT NULL,
    EmailAddress VarChar(100) NOT NULL,
    CONSTRAINT EMPLOYEE_PK PRIMARY KEY(EmployeeID)
    );

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Code:
    SQL> CREATE TABLE EMPLOYEE(
    EmployeeID Int NOT NULL IDENTITY(1,1),
    LastName Char(25) NOT NULL,
    FirstName Char(25) NOT NULL,
    Department Char(35) NOT NULL,
    Phone Char(12) NOT NULL,
    Fax Char(12) NOT NULL,
    EmailAddress VarChar(100) NOT NULL,
    CONSTRAINT EMPLOYEE_PK PRIMARY KEY(EmployeeID)
    );  2    3    4    5    6    7    8    9   10  
    EmployeeID Int NOT NULL IDENTITY(1,1),
                            *
    ERROR at line 2:
    ORA-00907: missing right parenthesis
    
    
      1  CREATE TABLE EMPLOYEE(
      2  EmployeeID Int NOT NULL ,
      3  LastName Char(25) NOT NULL,
      4  FirstName Char(25) NOT NULL,
      5  Department Char(35) NOT NULL,
      6  Phone Char(12) NOT NULL,
      7  Fax Char(12) NOT NULL,
      8  EmailAddress VarChar(100) NOT NULL,
      9  CONSTRAINT EMPLOYEE_PK PRIMARY KEY(EmployeeID)
     10* )
    SQL> /
    
    Table created.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    You'd rather switch from CHAR and VARCHAR to VARCHAR2 for all columns in that table.

  5. #5
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    IDENTITY(1,1) is invalid for Oracle.

    Please read the manual, it's all documented there: https://docs.oracle.com/cd/E11882_01...2.htm#i2201774
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •