oracle ORA-01735: 无效的 ALTER TABLE 选项(尝试删除 COLUMN 上的 DEFAULT 时)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42328439/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:23:29 来源:igfitidea点击:
ORA-01735: invalid ALTER TABLE option (While trying to drop DEFAULT on a COLUMN)
提问by Rishabh Tiwari
I was trying to drop DEFAULT constraint on COLUMN sal i.e. salary in customer table in Oracle Database.
我试图在 Oracle 数据库的客户表中删除 COLUMN sal ie 薪水的 DEFAULT 约束。
SQL statement which I tried was
我试过的 SQL 语句是
ALTER TABLE customer ALTER COLUMN sal DROP DEFAULT;
Error message which I received was
我收到的错误消息是
ALTER TABLE customer ALTER COLUMN sal DROP DEFAULT
Error report -
SQL Error: ORA-01735: invalid ALTER TABLE option
01735. 00000 - "invalid ALTER TABLE option"
*Cause:
*Action:
Can anyone tell me the mistake which I am doing?
谁能告诉我我正在做的错误?
回答by batnight
try this query :
试试这个查询:
ALTER TABLE customer MODIFY sal DEFAULT NULL;