Re: Possible to get better error handling for invalid enum parameter to stored program?

2009-03-08 Thread Steve Edberg
If you want to keep the enum column, you can set the strict SQL mode: mysql show variables like 'SQL_MODE'; +---+---+ | Variable_name | Value | +---+---+ | sql_mode | | +---+---+ 1 row in set (0.00 sec) mysql create table test2 (test

Re: Possible to get better error handling for invalid enum parameter to stored program?

2009-03-08 Thread David Karr
On Sun, Mar 8, 2009 at 3:31 PM, Steve Edberg sbedb...@ucdavis.edu wrote: If you want to keep the enum column, you can set the strict SQL mode: mysql show variables like 'SQL_MODE'; +---+---+ | Variable_name | Value | +---+---+ | sql_mode | |

Possible to get better error handling for invalid enum parameter to stored program?

2009-03-06 Thread David Karr
If I define an enum parameter for a stored program, and the calling code sends an invalid value, they get the less than useful data truncated error. Is it possible to define the stored program to produce better error handling for that kind of error? This is probably a FAQ, but in general, it

Re: Possible to get better error handling for invalid enum parameter to stored program?

2009-03-06 Thread Perrin Harkins
I'm afraid enums are useless for anything except compressing your data, since they don't reject bad values. If you want to limit a field to a set of values, you need to use a lookup table and a foreign key constraint. - Perrin On Fri, Mar 6, 2009 at 1:35 PM, David Karr

Re: Possible to get better error handling for invalid enum parameter to stored program?

2009-03-06 Thread David Karr
Thanks. I thought that was the case, but I wanted to be sure. On Fri, Mar 6, 2009 at 12:07 PM, Perrin Harkins per...@elem.com wrote: I'm afraid enums are useless for anything except compressing your data, since they don't reject bad values. If you want to limit a field to a set of values,