如果您使用“create as”创建一个 Oracle 表,其中某个字段为空,您将收到错误:
ORA-01723: 不允许零长度列
查询示例:
create table mytable as
select
field_a,
null brand_new_field
from anothertable;
如何解决这个问题?
发现需要使用cast(null as datatype)
create table mytable as
select
field_a,
cast(null as varchar(1)) brand_new_field
from anothertable;
更多信息here http://dbaora.com/create-table-as-select-and-null-columns-views/.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)