要修改的列不是标识列 [英] Column to be modified is not an identity column

查看:364
本文介绍了要修改的列不是标识列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个具有列S_ROLL NUMBER(3) NOT NULL的表,现在我想将此列作为标识列. 我用了这个命令

I have created a table with column S_ROLL NUMBER(3) NOT NULL Now I want to make this colum to as identity column. I used this command

alter table students
modify
(
S_ROLL NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY
);

然后我收到此错误.

S_ROLL NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY
*
ERROR at line 4:
ORA-30673: column to be modified is not an identity column

推荐答案

您收到此错误的原因仅仅是因为现在不支持将现有列修改为IDENTITY列.

You're getting this error simply because modifying an existing column as IDENTITY column is not supported right now.

解决方案是添加一个新列,然后删除现有的列(确保您确实也要处理数据).

The solution is to add a new column and then drop the existing one (making sure that you do take care of the data too).

这篇关于要修改的列不是标识列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆