Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I guess it's something like modes [] you're refering to (although it doesn't mention enums explicitly, the enum [] page does mention modes).

    Well, at least they fixed it in v5. Or is that the version you already use and where it doesn't work?
    • Nope, we're on an older version. At least v5 isn't quite as crippled as older versions.

      Regrettably, the 'modes' available pre v5 don't offer protection for this. At least I can use a trigger to ... oh, wait ... sigh. (And in a totally unrelated note, the problem the 'enum' was trying to fix could have been solved with a view, but since we don't have those either, the 'enum' solution was used)

  • MySQL has enums to save space (and thus improve speed), not to enforce values. For that, you should use a lookup table and a foreign key, like you would with Oracle. (Constraints are a lousy place to put a list of acceptable values because they are hard to edit from user apps.) Or you could run the database in "traditional" mode, which should make it throw an error for data that doesn't fit in an enum. Personally, I just avoid enums and use lookup tables, except for data warehouse situations where I hav