File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Oracle equivalent of MySQLs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Oracle equivalent of MySQLs "enum"?" Watch "Oracle equivalent of MySQLs "enum"?" New topic

Oracle equivalent of MySQLs "enum"?

Mark Justin

Joined: Sep 10, 2004
Posts: 1
Hi, does anyone know the Oracle equivalent of MySQLs "enum"? I have an enum like ENUM('yes', 'no', 'undecided').

Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
may be in 10g they added ENUM kind of thing. not sure i haven't come across ENUM in oracle 10g even. dont have much resource to refer for ORACLE 10g by now. but i have 3 solutions for you here:

1- associate a check constraint to that column.
drawback- if you ent to change the list you have to drop the constraint and then create it again, right.

2- you can have two create/replace triggers
drawback- it would be a bit slow in response. performance issue. but it will save you from droping the constraint and creating it again, right.

3- you can have a table in your DB. you can say a reference table like,


According to my perception 3rd one is better relatively. i used to do like this.
I agree. Here's the link:
subject: Oracle equivalent of MySQLs "enum"?