Blob
Blob

Reputation: 541

Keep getting the error "missing right parenthesis" when trying to create Oracle table

I have the following code in SQL developer, and when i try and run the code to create the table, it fails on this line: 'exists_flag varchar2(1) y/n,'

 create table moulds
 (mould_id  number,
 mould_type varchar2(50),
 mould_description varchar2(240),
 exists_flag varchar2(1) y/n,
 locate_id  number,
 );

Can anyone see what's wrong with the line and why it keeps saying "missing right parenthesis" ?

 create table moulds
 (mould_id  number,
 mould_type varchar2(50),
 mould_description varchar2(240),
 check (exists_flag in ( 'y', 'n' )),
 locate_id  number,
 PRIMARY KEY (mould_id)
 );

Upvotes: 1

Views: 269

Answers (1)

Raphaël Althaus
Raphaël Althaus

Reputation: 60493

replace y/n by

check (exists_flag in ( 'y', 'n' ))

Upvotes: 4

Related Questions