In Oracle 10i, I'm running the following command:
ALTER TABLE jnrvwchnglst ADD
( jnrvwchnglst_userid NUMBER(10) NOT NULL DEFAULT 1 )
Yes jnrvwchnglst
is an existing table and no jnrvwchnglst_userid
is not an existing column.
The Oracle error message is:
ORA-00907: missing right parenthesis
What's wrong with this query and why does Oracle think I'm missing a parenthesis?
To correct this error, you must find the part of code that contains the missing right parenthesis, insert the missing symbol in the correct spot, and run the statement again.
ORA-00907: missing right parenthesis error occurs when a left parenthesis is used without a right parenthesis to close it in SQL statements such as create table, insert, select, subquery, and IN clause. The right parenthesis is missing. All parentheses must be used in pairs.
The right parenthesis symbol is used in combination with the left parenthesis symbol to group one or more expressions together. Specifically, the right parenthesis symbol marks the end of a group. Parentheses are also used to represent multiplciation and within the notation of a function.
Solution 1 – Check Your Pairs of Parentheses If you're using an IDE such as SQL Developer, you can put your cursor next to each parenthesis to see where the matching parenthesis is. If it's in the right spot, great. If the match is showing up somewhere unexpected, then you're missing a parenthesis.
ALTER TABLE jnrvwchnglst ADD
( jnrvwchnglst_userid NUMBER(10) DEFAULT 1 NOT NULL )
"(NOT) NULL" must be the last statement in the "ALTER" syntactically when present, so when Oracle saw that - and that the next char (your "DEFAULT" stmt) wasn't the expected terminating right ")", threw the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With