Skip to content
Home » Oracle » How to Resolve ORA-00907: missing right parenthesis

How to Resolve ORA-00907: missing right parenthesis

ORA-00907

ORA-00907 means that SQL parser saw an illegal string or expression where it expects a right parenthesis to close the inner statement. Usually, it's a syntax problem.

SQL> create table fruits (fruit_name varchar2(20), price number not null default 20);
create table fruits (fruit_name varchar2(20), price number not null default 20)
                                                                    *
ERROR at line 1:
ORA-00907: missing right parenthesis

Please note that, the right parenthesis is also known as right round bracket. In CREATE TABLE statement, what parenthesis encloses is the column list.

In this case, DEFAULT is a valid reserved keyword, but it should be appeared before NOT NULL, not after. So we should rearrange the order of clauses in the statement to correct the problem.

SQL> create table fruits (fruit_name varchar2(20), price number default 20 not null);

Table created.

We fixed it.

In other words, if a right parenthesis was at the position where the error points out in the message, the statement should have no problem, unfortunately, it's unlikely what we want.

Leave a Reply

Your email address will not be published. Required fields are marked *