当前位置: 代码迷 >> Oracle管理 >> sqlplus增添字段出错
  详细解决方案

sqlplus增添字段出错

热度:7   发布时间:2016-04-24 04:53:42.0
sqlplus添加字段出错
为什么我写:
alter table employee
add salary number(7,3) not null default 0
会报错说:
第 2 行出现错误:
ORA-30649: 缺少 DIRECTORY 关键字
怎么解决?
------解决方案--------------------
引用:
为什么我写:
alter table employee
add salary number(7,3) not null default 0
会报错说:
第 2 行出现错误:
ORA-30649: 缺少 DIRECTORY 关键字
怎么解决?


把NOT null 放到 default 后面

hr@ORCL> create table t (n number);

Table created.

hr@ORCL> alter table t add i varchar2(10) default '0' not null;

Table altered.

  相关解决方案