This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript 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.
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!