8t修改字段的类型?

数据库:gbase8t问题:原来的列desc类型是TEXT类型,现在想换成lvarchar类型,语句如下:alter table customer modify(desc lvarchar(512));执行时报错信息如下:SQL 错误 [ErrorCode : -9633] [SQLState : IX000] : ALTER TABLE can not modify column (desc) type. Need a cast f...显示全部

数据库:gbase8t
问题:
原来的列desc类型是TEXT类型,现在想换成lvarchar类型,语句如下:
alter table customer modify(desc lvarchar(512));
执行时报错信息如下:
SQL 错误 [ErrorCode : -9633] [SQLState : IX000] : ALTER TABLE can not modify column (desc) type. Need a cast from the current type to the new type.
ALTER TABLE can not modify column (desc) type. Need a cast from the current type to the new type.

java.sql.SQLException

有大牛知道这个问题怎么解决吗?

收起
参与7

查看其它 1 个回答GBase_David的回答

GBase_DavidGBase_David  DBA , GBase

这里面可能有一个隐式的类型转化的问题。
最简单粗暴的办法就是新建一个完全一样的表:
insert into new_tab select * from old_table;
drop table old_table;

IT其它 · 2019-04-04

回答者

GBase_David 最近回答过的问题

回答状态

  • 发布时间:2019-04-04
  • 关注会员:2 人
  • 回答浏览:2590
  • X社区推广