File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC 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
Bookmark "Oracle equivalent of MySQLs "enum"?" Watch "Oracle equivalent of MySQLs "enum"?" New topic
Author

Oracle equivalent of MySQLs "enum"?

Mark Justin
Greenhorn

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').

Thanks.
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,

STATUS



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"?
 
Similar Threads
Oracle OCP equivalent in IBM DB2
retrieve enumeration datatype into jsp
20,000 ~ 30,000 rows Insert
How to define constants for several classes?
Error:Cannot create JDBC driver of class '' for connect URL 'null'