---
title: "ORA-00997 非法使用LONG 数据类型"
author: "xiaomogui"
date: "2010-11-16T00:23:55Z"
tags: []
categories: ["数据库"]
slug: "ora-00997-long"
draft: false
lastmod: "2010-11-16T00:23:55Z"
id: 812341
url: "https://xiaomogui.iteye.com/blog/812341"
---

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;

```

```