At 11:17 PM -0400 8/22/99, Dave Kaufman wrote:
>Andrian Pervazov <andrian@stripped> wrote...
>>Let's say I have a table where one of the fields is of the type SET,
>>SET('red','green',blue'). At some point I decide that 'red' should
>>be changed to
>>'darkred'. I do it with the ALTER TABLE ...
>>Now, I would normally expect that all the records which used to be 'red'
>>automatically become 'darkred'. However, they are all unset, i.e.
>>set to an empty
>try altering the table to add the "darkred" value (leaving "red" in place),
>then update tablename set color="darkred" where color="red"
>and then alter the table again, removing "red" from the set.
This would be easier if the column were an ENUM, because then you
could test the value to make sure it was just "red". But since it's
a SET, it could contain "red" anywhere in the set. Perhaps a job
for REPLACE(), and that might work well since "red" doesn't occur
as a substring of any of the other colors in the example.
Paul DuBois, paul@stripped