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 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

2同行回答

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

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

收起
IT其它 · 2019-04-04
zhaojunyongzhaojunyong  软件开发工程师 , 暂无
我的语句是:alter table customer modify(desc lvarchar(512));显示全部

我的语句是:alter table customer modify(desc lvarchar(512));

收起
软件开发 · 2019-04-03
浏览2047

提问者

zhaojunyong
软件开发工程师暂无
擅长领域: GBase 8t数据库

相关问题

问题状态

  • 发布时间:2019-04-03
  • 关注会员:2 人
  • 问题浏览:3218
  • 最近回答:2019-04-04
  • X社区推广