2

我想要一个 oracle 中的表,每列有 5 列,每列长度为 5000。
我正在使用varchar(5000),但它不允许。

Error starting at line 8 in command:
ALTER TABLE WORK_STATIC_DATA_AUDIT 
MODIFY ("NEW_VALUE" VARCHAR2(5000))
Error report:
SQL Error: ORA-00910: specified length too long for its datatype
00910. 00000 -  "specified length too long for its datatype"
*Cause:    for datatypes CHAR and RAW, the length specified was > 2000;
           otherwise, the length specified was > 4000.
*Action:   use a shorter length or switch to a datatype permitting a
           longer length such as a VARCHAR2, LONG CHAR, or LONG RAW 

我试过CLOB , LONG但它说我们只能有一个 CLOB 或 Long 每张桌子的 cloumn。
请帮我..

4

2 回答 2

1

我刚刚使用以下 DDL 创建并测试了表:

create table x (x clob,z clob,c clob,a clob, y long)

试试看。

可能有帮助... 2 列 long 被拒绝。

您还可以用作解决方法的是创建 5 个具有 1 个 id 列和 1 个长列的表,然后通过 ID 与您的主表连接。很长的路要走但有效

于 2013-03-07T07:14:45.857 回答
1

VARCHAR2 的限制是 4000 CHAR,因此您必须对长度为 4000 或更长的列使用 CLOB。正如您所指出的,每个表的 LONG 列数为 1,但每个表最多可以有 1000 个 CLOB(1000 是任何表的最大列数)。 使用 CLOB 应该可以实现 5 列,每列长度为 4000 或更多(如 5000)。 请参阅:Oracle 数据类型限制



于 2015-01-22T19:38:55.013 回答