If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Syntax error: Encountered "("

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-02-12, 10:57
xand xand is offline
Registered User
 
Join Date: Jan 2012
Posts: 6
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
Reply With Quote
  #2 (permalink)  
Old 02-02-12, 11:19
flyboy flyboy is offline
Registered User
 
Join Date: Mar 2007
Posts: 546
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.
Reply With Quote
  #3 (permalink)  
Old 02-02-12, 12:26
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,408
You have a redundant comma after the last NOT NULL statement (before the closing bracket)
Reply With Quote
  #4 (permalink)  
Old 02-02-12, 15:07
xand xand is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 02-02-12, 15:47
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
SQL*Plus should be your first choice, until you learn what SQL is and how it works. GUI - yes, but much later.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On