我有一个如下类型:
CREATE OR REPLACE TYPE tbusiness_inter_item_bag AS OBJECT (
item_id NUMBER,
system_event_cd VARCHAR2 (20),
CONSTRUCTOR FUNCTION tbusiness_inter_item_bag RETURN SELF AS RESULT
);
CREATE OR REPLACE TYPE BODY tbusiness_inter_item_bag
AS
CONSTRUCTOR FUNCTION tbusiness_inter_item_bag RETURN SELF AS RESULT
AS
BEGIN
RETURN;
END;
END;
当我执行以下脚本时,出现了"引用未初始化的组合体"错误,这在我看来相当合适。
DECLARE
item tbusiness_inter_item_bag;
BEGIN
item.system_event_cd := 'ABC';
END;
这也引发了相同的错误:
item.item_id := 3;
但如果我将对象类型更改为:
CREATE OR REPLACE TYPE tbusiness_inter_item_bag AS OBJECT (
item_id NUMBER(1),
system_event_cd VARCHAR2 (20),
CONSTRUCTOR FUNCTION tbusiness_inter_item_bag RETURN SELF AS RESULT
);
然后最后一条语句不再引发错误(此时我的“item”仍未初始化):
item.item_id := 3;
我会收到相同的ORA-06530错误吗?
ps:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64位