jQuery in Action, 3rd edition
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
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: http://aspose.com/file-tools
subject: Oracle equivalent of MySQLs "enum"?
jQuery in Action, 3rd edition