Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle equivalent of MySQLs "enum"?

 
Mark Justin
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, does anyone know the Oracle equivalent of MySQLs "enum"? I have an enum like ENUM('yes', 'no', 'undecided').

Thanks.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic