为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:达梦8
【操作系统】:
【CPU】:
【问题描述】*:
CREATE OR REPLACE TYPE type_modelid_in_tree AS object(id varchar,parent varchar);
CREATE OR REPLACE TYPE table_type_modelid_in_tree as table of type_modelid_in_tree;
CREATE OR REPLACE FUNCTION modelid_in_tree(parentid in varchar)
RETURN table_type_modelid_in_tree
AS
test_ table_type_modelid_in_tree;
sql_text VARCHAR(1000);
BEGIN
sql_text :=‘select type_modelid_in_tree(id,parent) from cmdb_resource_type t start with id =’‘’||parentid||‘’’ connect by prior t.parent=t.id’;
execute immediate sql_text bulk collect into test_;
return test_;
end modelid_in_tree;
Select modelid_in_tree(‘1022’);
同样的函数在本地数据库可以执行,在服务器上就我用sysdba和自建模式使用函数就会提示类[table_type_modelid_in_tree]不能作为查询项
请运行select id_code确认您数据库的版本