This set of responses is getting away from the original question. The lookup "data type" in Microsoft Access is not a data type at all. It creates a join with another table underneath the surface.
If you try to implement this with ENUM and Alter Table you will destroy the existing data/ENUM relationships for any values already in the table which fall after the value in the list which you removed. Either just add another table and do joins or live with only being to add to the list. Gordon Bruce Interstate Software A MySQL Training Partner > -----Original Message----- > From: Andrew Hazen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 17, 2002 2:40 PM > To: 'Gurhan Ozen'; [EMAIL PROTECTED] > Subject: RE: LOOKUP > > Good point. Also, how would you capture the current enum list to add or > substract from? Might have to hold that in an array or constant of some > sort depending upon the language used. > > Andrew Hazen > > > -----Original Message----- > From: Gurhan Ozen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 17, 2002 3:32 PM > To: Andrew Hazen; [EMAIL PROTECTED] > Subject: RE: LOOKUP > > Hi, > Your solution would work if the set of the values you'll get from one > table > is primary key.. If it is not a primary key, i.e. allowing duplicate > values, > then everytime there is an insertion to the table you will have to check > to > see if it is a new-added value or not. > > Gurhan > > -----Original Message----- > From: Andrew Hazen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 17, 2002 1:58 PM > To: 'Gurhan Ozen'; 'Simon Tienery'; [EMAIL PROTECTED] > Subject: RE: LOOKUP > > > That's what I thought too. A workaround occurs to me though, but I'm > not sure if it would muck things up. > > At any point where you make a change to the table you want to reference > as the "lookup" (as in Access), you could include another sql command to > alter the table with the enum column to change the list of accepted > values for the enum. > > Would this work Gurhan, or would the constant ALTER table commands mess > things up? > > Andrew Hazen > > > -----Original Message----- > From: Gurhan Ozen [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 17, 2002 1:46 PM > To: Andrew Hazen; 'Simon Tienery'; [EMAIL PROTECTED] > Subject: RE: LOOKUP > > 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 > > > --------------------------------------------------------------------- > 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 <mysql-unsubscribe- > [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