我想在另一种类型(Oracle)中的表类型中填充空值。我将只编写代码,它会更容易解释问题。
DECLARE
TYPE type_1 is record (col_1 varchar2(255),
col_2 varchar2(30),
col_3 varchar2(3)
);
TYPE table_1_tbl is table of type_1;
TYPE table_2 is record (col_1 varchar2(255),
col_2 varchar2(30),
t1 table_1_tbl
);
TYPE table_2_tbl is table of table_2;
TYPE type_3 is record (col_1 varchar2(30),
col_2 VARCHAR2(19),
t2 table_2_tbl
);
TYPE table_3_tbl is table of type_3;
Obj table_3_tbl;
BEGIN
select
'value_1',
'value_2',
null
BULK COLLECT INTO
Obj
FROM dual;
END;
/
此代码导致以下结果:
Error report:
ORA-06550: line 32, column 16:
PLS-00382: expression is of wrong type
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
如您所见,Oracle 不允许我使用 NULL 值来填充变量“obj”的“t3”列。你们知道我该怎么做吗?
注意:我不允许在架构中编译这些类型。