我尝试使用以下命令修改oracle对象内的number(7,0)
属性:
alter type myObjectFormat
modify ATTRIBUTE (
A NUMBER(7,2)) CASCADE FORCE;
ERROR:
Error report -
SQL Error: ORA-06545: PL/SQL: compilation error - compilation aborted
ORA-06550: line 10, column 32:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
exceptions
ORA-06550: line 0, column 0:
PLS-00565: MYOBJECTFORMAT must be completed as a potential REF target (object type)
06545. 00000 - "PL/SQL: compilation error - compilation aborted"
*Cause: A pl/sql compilation error occurred and the compilation was
aborted completely without the compilation unit being written
out to the backing store. Unlike ora-06541, the user will always
see this error along with the accompaning PLS-nnnnn error messages.
*Action: See accompanying PLS-nnnnn error messages.
我的目标如下:
create or replace type myObjectFormat
as object (
A number(7,0)
);
使用函数(显然只是重新创建错误的一个例子):
CREATE OR REPLACE FUNCTION STACKOVERFLOW RETURN MYOBJECTFORMAT AS
BEGIN
RETURN NULL;
END STACKOVERFLOW;
我尝试手动更改对象中的数据类型,但收到错误Error(1,1): ORA-02303: can't drop or replace a type with type or table dependents. SQLDev advises setting "Drop Type Force" preference
错误消息。 " easy"此时要做的是使用此对象删除函数,进行更改,然后重新创建函数。 " easy"随着这个数据库的增长,这种方式不可行。
Oracle参考资料:
我更喜欢使用alter type语句,只知道我的语法是否关闭?在我看来,我的FORCE
命令位于错误的位置。