0

我有一个 SQLBase-Database,我必须将 VARCHAR 列修改为 LONG VARCHAR 列。

由于无法在 sqlbase 中修改数据类型,我想创建一个临时列,将数据从 varchar 列切换到 temp 列,删除 varchar 列并重命名 temp 列。

这是我的 SQL 语句:

ALTER TABLE NetworkShares ADD TEMP LONG VARCHAR;
UPDATE NetworkShares SET TEMP = Passwort;
ALTER TABLE NetworkShares DROP Passwort;
ALTER TABLE NetworkShares RENAME TEMP Passwort;

但是使用我的代码,我得到了这个错误消息:

Error: 01602 TYP MBB Long must be set to bind variable

有什么想法可以解决我的问题吗?

4

1 回答 1

1
create table TMP_NetworkShares(
    <define all columns here as per NetworkShares>,
    PASSWORT long varchar not null
) pctfree 10;

insert into TMP_NetworkShares(
    <define all columns here as per NetworkShares>,
    PASSWORT ) select
    <define all columns here as per NetworkShares>,
    PASSWORT
        from NetworkShares;

drop table NetworkShares;

alter table TMP_NetworkShares rename table NetworkShares;

grant all on NetworkShares to PUBLIC;
于 2016-02-01T16:52:59.470 回答