【发布时间】:2015-04-28 00:51:48
【问题描述】:
create or replace type try_object as object(
my_name varchar2(10),
roll number
);
/
create or replace type try_object_tab as table of try_object;
/
alter type try_object modify attribute (my_name varchar2(5)) cascade;
执行上述行后,我收到此错误
Error starting at line : 27 in command -
alter type try_object modify attribute (my_name varchar2(5)) cascade
Error report -
SQL Error: ORA-22324: altered type has compilation errors
ORA-22328: object "TRIJIT"."TRY_OBJECT" has errors.
PLS-00719: only widening of attribute 'MY_NAME' constraints is allowed
ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated
22324. 00000 - "altered type has compilation errors"
*Cause: The use of the ALTER TYPE statement caused a compilation error.
*Action: Correct the error reported and resubmit the statement.
我想知道当我完全遵守 oracle 文档时错误到底是什么。任何人都可以帮我解决这个问题吗?谢谢..
【问题讨论】:
-
您遵循哪些文档?错误消息似乎提供了很多信息——你不能让
my_name变小,一旦你有了对象表,你就可以把它变大。您是说您在某处找到了表明允许这样做的文件吗?如果是这样,链接到文档并指定您正在使用的确切 Oracle 版本会很有帮助。 -
对不起老兄...我以为这只是一个例子...我们也可以反过来做...无论如何非常感谢...