WL#1506: ALTER TABLE .... SET column=expr
Affects: Server-7.1 — Status: Un-Assigned — Priority: Medium
The below is excerpts from Monty's idea in IRC discussion, with minor Bar's changes. How about adding the syntax into ALTER TABLE: SET column=expr This way one can also do transforms of data during the alter table, which makes it much easier in some cases, particulary in the case of character set conversions when migrating from 4.0. ALTER table t1 change a b int(4), SET b=a/100; The above changes field a to b and updates it from the old value through a forulma. Note, there should be a ',' before SET. The idea would be that all variables that are 'set' are in new table, but all fields in expression comes from old table So it would be allowed to do: ALTER table t1 modify a int(4),SET a=a/100 In this case the first a in SET is in new table and a in a/100 is from original table, before conversion.
Copyright (c) 2000, 2017, Oracle Corporation and/or its affiliates. All rights reserved.