Ugh, I am being too goofy today.. Simon, the answer to the question is no, you can't do that in MySQL. You can, however, create a column with enum datatype and define set of valid values. In a case where you try to insert an invalid value to an enum field, it will insert an empty string for it. Sincerely,
Gurhan -----Original Message----- From: Andrew Hazen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 17, 2002 12:54 PM To: 'Gurhan Ozen'; 'Simon Tienery'; [EMAIL PROTECTED] Subject: RE: LOOKUP Gurhan, I think Simon was looking for a way to make the enum dynamic from another table. ?????? Andrew Hazen -----Original Message----- From: Gurhan Ozen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 17, 2002 10:22 AM To: Simon Tienery; [EMAIL PROTECTED] Subject: RE: LOOKUP Hi .. You can define ENUM datatype for a column while creating the table and along with the possible values, and if you are using phpMyAdmin to admin MYSQL, it will only give you the possible values for that ENUM column. See: http://www.mysql.com/doc/C/o/Column_types.html http://www.phpmyadmin.net/ Gurhan -----Original Message----- From: Simon Tienery [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 17, 2002 3:50 AM To: [EMAIL PROTECTED] Subject: LOOKUP Dear Group, Could anyone help me please, I want to create an ENUM column in one table that lists the entries in another table. For example, the sales table to have a "staff" column that automatically gives a choice of the names of all staff listed in the staff table. I have been told that Access has a data type that does this called lookup, but I only want to use MySQL. I couldn't locate the answer in the manual and I'd appreciate it if someone can explain how this can be achieved / worked around. many thanks Simon T --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php