From: Date: March 20 2001 6:48pm Subject: RE: Second Request - Limit Filed Input List-Archive: http://lists.mysql.com/mysql/68881 Message-Id: <5.0.2.1.2.20010320124340.023916d0@apocalypse.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed At 11:22 AM 3/20/2001 -0500, Ravi Raman wrote: >You can use an ENUM column type assuming the numerical range is less than >65535 numbers. > >http://www.mysql.com/doc/E/N/ENUM.html One problem I've seen with enums is that I end up with a blank ('') field if I try to insert a row with a value in the enum column that doesn't fit. Is there a way to get the insert to fail on "bad input" instead? For example: mysql> CREATE TABLE Stats ( -> Status enum('good','bad') NOT NULL -> ); Query OK, 0 rows affected (0.00 sec) mysql> INSERT INTO Stats VALUES ('neither'); Query OK, 1 row affected (0.00 sec) (Can I get this insert to FAIL instead? because...) mysql> select * FROM Stats; +--------+ | Status | +--------+ | | +--------+ 1 row in set (0.01 sec) (this isn't always a good thing). -bill