为什么我不能使用这样的Oracle用户定义类型? [英] Why can't I can't I use my Oracle user defined type like this?
问题描述
在Oracle软件包中,我定义了一个类型
In an Oracle package I have defined a type
type setTable is table of my_sets.pkey%type;
包声明中的
(非主体部分).引用的pkey
列是number(38)
.然后在包体内的函数中,我有
in the package declaration (the non-body part). The pkey
column referenced is a number(38)
. Then in a function in the package body I have
...
with d as (select column_value from table(sets)),
...
其中,sets
是类型settable
的函数的参数.该行无法编译,并显示错误"ORA-22905:无法访问非嵌套表项中的行".我该怎么办才能解决这个问题?
where sets
is a parameter to the function of type settable
. This line fails to compile with the error 'ORA-22905: cannot access rows from a non-nested table item'. What can I do to resolve this?
推荐答案
select语句不是SQL的PL/SQL,SQL引擎只能使用服务器上定义的类型,如下所示:
The select statement is SQL not PL/SQL, and the SQL engine can only work with types defined on the server like this:
create type setObj is object (<attributes>);
create type setTable is table of setObj;
这篇关于为什么我不能使用这样的Oracle用户定义类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!