在sql server中執(zhí)行下屬語句 不會出錯
alter table grand_son add testCol varchar2(40) not null DEFAULT '**';
但是在oracle 里執(zhí)行該語句時 提示 ORA-30649: 缺少 DIRECTORY 關(guān)鍵字
后發(fā)現(xiàn)語句 oracle 和sql server 通用的支持方法
把NOT null 放到 default 后面,就是如下寫法,sql server 和 oracle 都能正常執(zhí)行
alter table grand_son add testCol varchar2(40) DEFAULT '**' not null;
alter table grand_son add testCol varchar2(40) not null DEFAULT '**';
但是在oracle 里執(zhí)行該語句時 提示 ORA-30649: 缺少 DIRECTORY 關(guān)鍵字
后發(fā)現(xiàn)語句 oracle 和sql server 通用的支持方法
把NOT null 放到 default 后面,就是如下寫法,sql server 和 oracle 都能正常執(zhí)行
alter table grand_son add testCol varchar2(40) DEFAULT '**' not null;