Oracle'c COLLECT函数触发创建新的集合类型。 有没有办法禁用这种行为?
这是正在发生的事情......
检查现有用户类型
select object_name from user_objects where object_type = 'TYPE'
no rows selected.
使用集合VARRAY包装类型
创建用户数据类型CREATE OR REPLACE TYPE TEST_T
AS OBJECT (C1 VARCHAR2(20 BYTE), C2 VARCHAR2 (11 Byte));
CREATE OR REPLACE TYPE ARRAY_TEST_T AS VARRAY(200) OF TEST_T;
检查类型......
select object_name from user_objects where object_type = 'TYPE'
OBJECT_NAME
------------
TEST_T
ARRAY_TEST_T
2 rows selected.
现在此查询将触发创建新的集合类型:
select cast(collect(TEST_T(c1,c2)) AS ARRAY_TEST_T)
from ( select '1.1' as c1, '1.2' as c2 from dual ) ;
再次检查类型......
select object_name from user_objects where object_type = 'TYPE'
OBJECT_NAME
-----------------------------
TEST_T
SYSTP5Iel7MEkRT2osGnB/YcB4A==
ARRAY_TEST_T
3 rows selected.
Oracle使用以下规范创建了新的集合类型“SYSTP5Iel7MEkRT2osGnB / YcB4A ==”:
CREATE OR REPLACE TYPE "SYSTPzGCo9gclT3WmlUX5SNtEPg==" AS TABLE OF TEST_T
答案 0 :(得分:1)
阅读http://www.oracle-developer.net/display.php?id=306
我认为当你定义时它会起作用:
创建或替换类型ARRAY_TEST_T作为TEST_T表;
所以没有......的变形(200),但......的表。