首页 > 数据库技术 > 详细

向数据库表中添加列,出现缺少 DIRECTORY 关键字错误

时间:2015-05-17 20:17:33      阅读:475      评论:0      收藏:0      [点我收藏+]

在sql server中执行下属语句 不会出错
alter table grand_son add testCol varchar2(40)  not null DEFAULT ‘**‘;
但是在oracle 里执行该语句时 提示 ORA-30649: 缺少 DIRECTORY 关键字
后发现语句 oracle 和sql server 通用的支持方法
把NOT null 放到 default 后面,就是如下写法,sql server 和 oracle 都能正常执行
alter table grand_son add testCol varchar2(40) DEFAULT ‘**‘ not null; 

向数据库表中添加列,出现缺少 DIRECTORY 关键字错误

原文:http://www.cnblogs.com/string1992/p/4510297.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!