Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing right parenthesis on CREATE TABLE statement

I'm getting an

ORA-00907 error, missing right parenthesis

when attempting to create a table w MySQL.

I have looked extensively on the web but found nothing that could help me here..

Here is my CREATE TABLE statement:

CREATE TABLE station
(
nomStation varchar2(255),
capacite number(15) NOT NULL,
lieu varchar2(255) NOT NULL,
region ENUM('Quebec', 'Ontario', 'NewBrunswick', 'NovaScotia'),
tarif number(10) DEFAULT 0,
CONSTRAINT station_nomStation_pk PRIMARY KEY(nomStation)
);
like image 255
Sebastien Avatar asked May 16 '26 21:05

Sebastien


1 Answers

In my experience, "ORA-00907 error, missing right parenthesis" is usually triggered by a wrong number of commas, like adding an extra comma after your final column or constraint.

However, in your case some googling seems to indicate that Oracle doesn't support the ENUM syntax you're using. Instead, you should use a CHECK, like described in this blog post.

like image 50
Petter Brodin Avatar answered May 23 '26 19:05

Petter Brodin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!