Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2012
    Posts
    6

    Unanswered: Syntax error: Encountered "("

    hi guys,

    for example:

    CREATE TABLE EMPLOYEE_INPUT (
    EMPLOYEE_ID NUMBER(6) NOT NULL,
    FIRST_NAME VARCHAR2(20) NULL,
    LAST_NAME VARCHAR2(25) NOT NULL,
    );


    any idea, why it always shows Syntax error: Encountered "(" near NUMBER(6)

    (i use 10g XE)

    thx

  2. #2
    Join Date
    Mar 2007
    Posts
    623
    Hi thx,
    to be honest, I do not know. Probably you have very creative tool for interacting with Oracle. However it would be helpful, if you posted the exact error with its ORA numeric code (although the one you posted does not look like Oracle one - that "near" word comes from other RDBMS; are you sure it is from Oracle?).
    Anyway, in standard Oracle sqlplus, the error is different:
    Code:
    SQL> CREATE TABLE EMPLOYEE_INPUT (
      2  EMPLOYEE_ID NUMBER(6) NOT NULL,
      3  FIRST_NAME VARCHAR2(20) NULL,
      4  LAST_NAME VARCHAR2(25) NOT NULL,
      5  );
    )
    *
    ERROR at line 5:
    ORA-00904: : invalid identifier
    Yes, the last comma followed by nothing is the cause.

  3. #3
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    You have a redundant comma after the last NOT NULL statement (before the closing bracket)

  4. #4
    Join Date
    Jan 2012
    Posts
    6
    thanks both
    I have writen bad sql code for you, lol... that comma after last NULL I hadnt in editor, but error was still there.

    I use Netbeans for interacting with Oracle and when I restarted it, code ran.
    Now I installed Toad. Or do you know about better software? I'm just learning Oracle and SQL

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    SQL*Plus should be your first choice, until you learn what SQL is and how it works. GUI - yes, but much later.

Posting Permissions

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