On Mon, Mar 14, 2016 at 8:52 AM, Joshua D. Drake <j...@commandprompt.com>
wrote:

>
>  If improved enough, maybe we could get to a
>> point where they could actually be used; otherwise why the heck did we
>> let the feature in the database in the first place?  I think all these
>> "use a lookup table, you silly!" answers are missing the point.
>>
>
> 1. I thought ENUMS were not needed in the first place. I still do.
>
> 2. I never called anyone silly, nor was I derogatory or dismissive. I
> offered, my solution to this problem because ENUMS are a pain in the butt
> and have been since the original implementation. I have yet to see a valid
> reason to use them instead of a lookup table. I have even written articles
> about the three basic solutions:
>
>
> https://www.commandprompt.com/blogs/joshua_drake/2009/01/fk_check_enum_or_domain_that_is_the_question/


​The one nice thing about enums is that you get two concepts in one column
- a human readable label and a system used ordering.

i.e., "SELECT enum_value FROM tbl ORDER BY enum_value" actually
​

​gives you a meaningful order without having to carry around, or relink to,
a lookup table to get an ordering column.

​Now, this is a bit overrated since you immediately lose that ability if
you export to a Spreadsheet program, or otherwise lose the ordering nature
during a convert-to-text operation.

​
​
​David J.
​

Reply via email to