How to add column in oracle with enum values?

How to use enums in Oracle?

In the above article, I am invited to create an Enum column when creating a table. But I have a table that has values. I wanted to add another column with Enum values.

ALTER TABLE CARS **(ADD** BODY_TYPE VARCHAR2(20) CHECK (BODY_TYPE IN ('COUPE','SEDAN','SUV')) ); 

I get a syntax error near ADD . Please guide.

+4
source share
1 answer

Put "add" to "(".

 alter table cars add ( body_type varchar2(20) not null check (body_type in ('COUPE','SEDAN','SUV')) ); 
+6
source

All Articles