-1

I have the following the error in my sql program:

"ORA-00907: missing right parenthesis

  1. 00000 - "missing right parenthesis" and I have no idea where the bug is. This is my code:
DROP TABLE angajat;

CREATE TABLE angajat (
  id int(11) PRIMARY KEY,
  last_name varchar(64),
  first_name varchar(64),
  email varchar(64),
  department varchar(64),
  salary int(11) );
pifor
  • 7,419
  • 2
  • 8
  • 16
  • 1
    `int(11)` is not a type in Oracle. – Gordon Linoff Jun 10 '20 at 16:16
  • I assume by the error message that you are using Oracle. Just because Oracle bought MySQL does not mean that there original DBMS is now called MySQL. Unfortunately terminology like this matters when you are asking questions – RiggsFolly Jun 10 '20 at 16:22

1 Answers1

1

In Oracle Database you could code:

SQL> select banner from v$version where rownum=1;

BANNER
--------------------------------------------------------------------------------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

SQL> CREATE TABLE angajat (
  2    id number(11) PRIMARY KEY,
  3    last_name varchar(64),
  4    first_name varchar(64),
  5    email varchar(64),
  6    department varchar(64),
  7    salary number(11) );

Table created.

SQL> 

But to be compatible with most Oracle existing code you should use VARCHAR2 instead of VARCHAR: see difference about VARCHAR and VARCHAR2.

pifor
  • 7,419
  • 2
  • 8
  • 16