File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Oracle equivalent of MySQLs "enum"?
Joined: Sep 10, 2004
Sep 10, 2004 03:05:00
Hi, does anyone know the Oracle equivalent of MySQLs "enum"? I have an enum like ENUM('yes', 'no', 'undecided').
Joined: Aug 15, 2004
Sep 10, 2004 06:03:00
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:
associate a check constraint to that column.
if you ent to change the list you have to drop the constraint and then create it again, right.
you can have two create/replace triggers
it would be a bit slow in response. performance issue. but it will save you from droping the constraint and creating it again, right.
you can have a table in your DB. you can say a reference table like,
STATUS_ID STATUS_NAME 0 valid 1 invalid 2 active 3 inactive
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"?
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'
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014