ITeye博客

ORA-00997 非法使用LONG 数据类型

xiaomogui · 2010-11-16 00:23 · oracle · 数据库 · Markdown

long列是不允许出现在 create table xx as select * from yyy


 里的
In addition, LONG columns cannot appear in these parts of SQL statements:
....
SELECT lists of

CREATE TABLE ... AS SELECT statements


 
.....
oracle建议使用clob\blob\nclob来代替。
如:

create table t(a int,b long); insert into t values(1,'1');


 --可以这样创建,不过默认类型就成了clob

create table t1 as select a,to_lob(b) from t;


 
--也可以这样,先创建一个表,然后在插入数据时使用to_lob函数转换一下

create table t2 (a int,b long); insert into t2 select a,to_lob(b) from t;


评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。