3

Within Teradata, when executing an ALTER TABLE command to modify the data type for an existing column from VARCHAR(10) to CHAR(10), I receive a 3558 error indicating that the specified attribute can not be altered. Is there an alternate method of coding this to achieve the desired objective or does the column need to be dropped and re-created in order to change the data type?

4

1 回答 1

4

当内部存储发生变化时,您无法修改数据类型,VARCHAR <-> CHAR 就是这种情况。

而不是ADD CHAR -> UPDATE CHAR from VARCHAR (需要一个巨大的瞬态日志) -> DROP VARCHAR你最好创建一个新表 -> INSERT/SELECT (no TJ) -> DROP/RENAME

编辑:正如 Rob Paller 所建议的,使用 MERGE INTO 而不是 INSERT SELECT 将避免假脱机源表。

于 2013-08-14T21:45:37.927 回答