Derby 不能修改列类型 CANNOT Alert Column Data type

Categories: Database; Tagged with: ; @ October 6th, 2010 16:03

Derby(10.5)中不能通过Alert修改Column的DataType, 可能需要重建Column才能实现DataType的修改.

文档: Modifying columns http://db.apache.org/derby/docs/10.5/ref/rrefsqlj81859.html

The column-alteration allows you to alter the named column in the following ways:

  • 1. 增加VARCHAR/VARCHAR FOR BIT DATA 的宽度 Increasing the width of an existing VARCHAR or VARCHAR FOR BIT DATA column. CHARACTER VARYING or CHAR VARYING can be used as synonyms for the VARCHAR keyword.

    To increase the width of a column of these types, specify the data type and new size after the column name.

    你不能减少列宽也不能改变数据类型 You are not allowed to decrease the width or to change the data type. You are not allowed to increase the width of a column that is part of a primary or unique key referenced by a foreign key constraint or that is part of a foreign key constraint.

  • 2. 设置标识列步进值 Specifying the interval between consecutive values of the identity column.

    To set an interval between consecutive values of the identity column, specify the integer-constant. You must previously define the column with the IDENTITY attribute (SQLSTATE 42837). If there are existing rows in the table, the values in the column for which the SET INCREMENT default was added do not change.

  • 3. 修改是否允许为空 Modifying the nullability constraint of a column.
  • 4. 修改默认值 Changing the default value for a column.

<->



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.